简体   繁体   中英

doubts on getting value of any word from editText

I have already Entered some text in my editText . I want to get the value of any word selected form the text to any variable.I already tried textvaluechanged() and textwatcher() but it seems i dint understand the concept ...

You can get the content of android's edittext by calling http://developer.android.com/reference/android/widget/EditText.html#getText()

Like this:

EditText edit = (EditText) findViewById(R.id.{replace for ID of EDITTEXT});    
String inputString = edit.getText().toString();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM