How to check an EditText has focus? is there any method boolean hasFocus()
Yes, hasFocus()
is there, inherited from android.view.View
Another way to achieve this
EditText et = (EditText) findViewById(R.id.edittxt);
if(this.getCurrentFocus().getId() == et.getId()){
// your view is in focus
}else{
// not in the focus
}
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