我在使可編輯時遇到問題 - 雖然我可以使其可編輯,但我無法通過 .textviewintent在我的活動中,對于我的文本框,我有:xmlViewtextViewComment<TextViewandroid:id="@+id/textViewComment"android:layout_width="match_parent"android:layout_height="wrap_content"android:layout_weight="1"android:background="@drawable/textboxes_for_contact"android:textIsSelectable="true"中的文本確實是可選的,我可以通過長按復(fù)制它。textbox但是,我有一個活動 - 當(dāng)在活動中單擊編輯按鈕時,中的文本應(yīng)使用 .相反,我的是空的。EditViewtextViewCommentEditintentEdittextEditView當(dāng)我刪除文本時,通過意圖成功傳遞。但。。。我無法在 .android:textIsSelectable="true"textview我也以編程方式嘗試過,但這給出了同樣的問題。commentname.setTextIsSelectable(true);在課堂上我有ViewContacti.putExtra("comment", commentname.getText());在課堂上:EditContactcomment = i.getStringExtra("comment");在我的班級里是:xmlEditContacttextViewComment <EditText android:id="@+id/textViewComment" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" android:inputType="textCapSentences" android:background="@drawable/textboxes_for_contact" android:maxLength="360" />任何想法,我如何使文本可選,同時也成功通過?這是一個已知問題嗎?ViewContactintent
1 回答

絕地?zé)o雙
TA貢獻1946條經(jīng)驗 獲得超4個贊
取代:
i.putExtra("comment", commentname.getText());
跟:
i.putExtra("comment", commentname.getText().toString());
看看你是否有更好的運氣。
添加回答
舉報
0/150
提交
取消