Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/234.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何使android:textIsSelectable=“true”符合我的意图?_Java_Android_Android Intent - Fatal编程技术网

Java 如何使android:textIsSelectable=“true”符合我的意图?

Java 如何使android:textIsSelectable=“true”符合我的意图?,java,android,android-intent,Java,Android,Android Intent,我无法将文本视图设置为可编辑状态-虽然我可以将其设置为可编辑状态,但无法通过意图将文本传递给其他活动 在我的视图活动的xml中,对于我的textViewComment文本框,我有: <TextView android:id="@+id/textViewComment" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" android:backg

我无法将文本视图设置为可编辑状态-虽然我可以将其设置为可编辑状态,但无法通过意图将文本传递给其他活动

在我的视图活动的xml中,对于我的textViewComment文本框,我有:

<TextView
android: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"
在EditContact类中:

textViewComment的我的EditContact类中的xml为:

您知道如何在成功传递意图的同时使ViewContact中的文本可选择吗?这是已知问题吗?

更换:

 i.putExtra("comment", commentname.getText());
与:


看看你是否运气更好。

i.putexcomment,commentname.getText.toString;
comment = i.getStringExtra("comment");
        <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"
            />
 i.putExtra("comment", commentname.getText());
 i.putExtra("comment", commentname.getText().toString());