Skip to content Skip to sidebar Skip to footer

Get Text From An Edittext

In my app I have an EditText that I want to get the value out of when it looses focus. How should I do this? Thanks!

Solution 1:

Along the lines of this should work.

EditText.setOnFocusChangeListener(new View.OnFocusChangeListener()
{ 
   @override
   public void onFocusChange(View v, boolean hasFocus)
   {
       if (!hasFocus) {
           string value = (EditText) v.getText().ToString();
       }
   }
}

Post a Comment for "Get Text From An Edittext"