Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

make Android Textview or EditText selectable

I want to make EditText or Textview selectable in my android project . project is for android 4.0+ . I add this : txtView.setTextIsSelectable(true) and also : txtView.setCustomSelectionActionModeCallback(new myCallback()); to make my custom selection menu . but this error happend when i want to select the text .

W/TextView﹕ TextView does not support text selection. Action mode cancelled.

i searched about the error but didn't find the solution .what should i do ?

like image 836
HAMED Avatar asked Jan 19 '26 05:01

HAMED


1 Answers

<TextView
    android:id="@+id/id"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textIsSelectable="true"
    android:text="" />

*API Level 11 and up only

like image 187
sakir Avatar answered Jan 20 '26 20:01

sakir



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!