0

Possible Duplicate:
Select + copy text in a TextView?

  1. Can I prevent the user from editing the text in the edittext box?

  2. Also is it possible copy text from an edittext box in Android without the softkeyboard showing?

Basically I want a text file (e.g. a story) displayed on an Android with the user having the opportunity to copy and paste. I don't want user to be able to edit the text nor do I want to keyboard to show while copying and pasting.

Thanks

Community
  • 1
  • 1
user1637392
  • 11
  • 1
  • 2

2 Answers2

0

One way to do this is that you can use a TextView instead of a EditText to display the text. Then you can put a copy icon or button near the text and programmatically copy the text using the guide here:

http://developer.android.com/guide/topics/text/copy-paste.html

See this thread as well:

Copy text from TextView on Android

Community
  • 1
  • 1
Anup Cowkur
  • 20,443
  • 6
  • 51
  • 84
0

For Prevent Editing of Text just put android:editable="false" inside your EditText attributes in the xml file.

And for allowing Copy & Paste, just put android:textIsSelectable="true" inside the same.

I hope you get what you want.

ban-geoengineering
  • 18,324
  • 27
  • 171
  • 253
Manish
  • 1,259
  • 3
  • 11
  • 20