select some text in the edittext on drag

Viewed 1088

I want to select some text in the edittext,but I do not know how to do it.

I need such method: when the user touch the screen then drag and off the screen,the text that dragged will be selected.(my English is poor,so do not mind it,thanks)

textView = (EditText) findViewById(R.id.textvie1);  
InputStream inputStream=getResources().openRawResource(value+0x7f040000);
String string = reader.getString(inputStream);textView.setMovementMethod(new ScrollingMovementMethod());
textView.setText(string);
2 Answers

i think what you are trying to do is to select the text in the editText right? edit your layout and add the following line to the editText

android:selectAllOnFocus="true"

from official android documentation

Related