Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.
added 18 characters in body; edited title
Source Link
thkala
  • 86.9k
  • 24
  • 167
  • 205

Android question,- get selection of text from EditText

I'm trying to implement a copy/paste function. How can I get a selection of text from an EditText?

EditText et=(EditText)findViewById(R.id.title);

EditText et=(EditText)findViewById(R.id.title); 

blabla onclicklistener on a button: int startSelection=et.getSelectionStart(); int endSelection=et.getSelectionEnd();

int startSelection=et.getSelectionStart(); int endSelection=et.getSelectionEnd(); 

Then I'm stuck. Any ideas?

Android question, get selection of text from EditText

I'm trying to implement a copy/paste function. How can I get a selection of text from an EditText?

EditText et=(EditText)findViewById(R.id.title);

blabla onclicklistener on a button: int startSelection=et.getSelectionStart(); int endSelection=et.getSelectionEnd();

Then I'm stuck. Any ideas?

Android - get selection of text from EditText

I'm trying to implement a copy/paste function. How can I get a selection of text from an EditText?

EditText et=(EditText)findViewById(R.id.title); 

blabla onclicklistener on a button:

int startSelection=et.getSelectionStart(); int endSelection=et.getSelectionEnd(); 

Then I'm stuck. Any ideas?

Source Link
Laise
  • 101
  • 1
  • 1
  • 3

Android question, get selection of text from EditText

I'm trying to implement a copy/paste function. How can I get a selection of text from an EditText?

EditText et=(EditText)findViewById(R.id.title);

blabla onclicklistener on a button: int startSelection=et.getSelectionStart(); int endSelection=et.getSelectionEnd();

Then I'm stuck. Any ideas?