I have a requirement function onBlur like javascript in android. When user exit from an EditText field after typing something in it, then i want to show a Toast. It seems very simple but i could not find it. Any help would highly be appreciated.
Try something like this:
mEditText.setOnFocusChangeListener(new OnFocusChangeListener() { @Override public void onFocusChange(View v, boolean hasFocus) { if (!hasFocus) Toast.makeText(getApplicationContext(), "unfocus", 2000).show(); } });
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With