Search code examples
androidandroid-edittextandroid-softkeyboardlost-focus

Why doesn't EditText lose focus after soft keyboard is hidden?


How does EditText still have focus after the soft keyboard is hidden (user presses Done/Enter/Search button)?

Could you please provide me some explanation about this?


Solution

  • Your app and Android soft keyboard (stock one) are different app processes. And while Android takes care of "notifying" the soft keyboard app on your app's EditText focus requests, neither Android nor the soft keyboard app should be responsible for your app's EditText focus changes. Your app has enough callbacks from the soft keyboard at its disposal to clear focus.