views:

340

answers:

2

Is it Possible to Display some text say a story, in an ANDROID app which also enables the user to select some text and perform some operations on that text..

the main idea is to display some text and when the user selects some text(a word or a sentence) i need to get that text for some further operation on that text.

we cant use text view as you cant select text in textview,and we cant use editview because the user should not be able to edit the contents of the text.

A: 

My first try would be to display this text in a normal TextView. Then I would provide two or three buttons to implement the selection of a part of the text. For example 1 Button to start and end selection and 2 Buttons with arrows for increasing/decreasing the part of the selection.

To highlight the part of the text which is selected, I would for example color this part of the text in a different color.

Coloring of text can be either done by using Spannable or the HTML class.

Roflcoptr
A: 

Why not display the text in a WebView and enable text selection?

It works pretty well in CodePad, which is open source so you can have a look at the code here.

HXCaine