When my app starts, I loaded some text inside EditText which cannot be edited by the user, until click 'menu' and select 'edit text'. The initial xml looks like the below:
<EditText
android:id="@+id/myTextBox"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:cursorVisible="true"
android:gravity="top"
android:inputType="none"
android:textIsSelectable="true"
android:scrollbars="vertical"
android:maxLines="1"
/>
After user selects 'edit text', how to I make it editable again? I tried doing the below in code:
_mytextBox.setInputType(InputType.TYPE_CLASS_TEXT|InputType.TYPE_TEXT_FLAG_MULTI_LINE);
_mytextBox.setTextIsSelectable(false);
But the keyboard never shows up again.. If I remove textIsSelectable from xml and use android:inputType="textMultiLine", it works just like I wanted.
Additional Info: Sorry forgot to mention, I cannot use the disable/enable way because I would like the user to be able to select any text inside and do a 'copy'. Also, disabling it will dim the text.. which is not what I want. Thanks!
I would have expect that calling _mytextBox.setTextIsSelectable(false); would reset everything to normal, but it doesn't.. seems like a bug? Might be related to this issue: https://code.google.com/p/android/issues/detail?id=27609