How do I enable standard copy paste for a TextView in Android?

Ixx picture Ixx · Apr 30, 2012 · Viewed 86.2k times · Source

I want to enable standard copy paste for a TextView (the same as for EditText). How can I do it?

I tried using a non-editable EditText but it didn't work well (sometimes it became editable or the copy paste overlay was not shown). And it's probably not a good approach generally.

Need a working solution starting at API 7.

Answer

CommonsWare picture CommonsWare · Apr 30, 2012

Try android:textIsSelectable.

i.e., android:textIsSelectable="true"