开发者

Get text from an EditText

In my app I have an EditText that I w开发者_JAVA技巧ant to get the value out of when it looses focus. How should I do this?

Thanks!


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();
       }
   }
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜