I have a textview which displays a lot of text.
My users want to highlight and copy a snip of code to the clipboard.
Any pointers on how to do that?
Select + copy text in a TextView? Generally, we can copy / paste the value from EditText by long click. It is an in-build functionality for Android.
Long-tap a word to select it on a web page. Drag the set of bounding handles to highlight all the text you want to copy. Tap Copy on the toolbar that appears.
Updating the Android Studio and Invalidate Caches/Restart option doesn't worked for me. But Paste Simple or Ctrl + Alt + Shift + V will works when you are trying to paste something from outside. Try using Copy Reference or Ctrl + Alt + Shift + C and Paste or Ctrl + V . It works for me.
Highlight the text, long-press the selected text, then choose Copy. Long-press an empty field and select Paste to insert the copied text. Alternative method: Use the Gboard keyboard to manage the clipboard.
Modify the textIsSelectable
property:
android:textIsSelectable="true"
Have you tried Copy Paste - Android Developers Site?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With