Rectangle 27 0

Android: Detect When Soft Keyboard Is About to Show?

I thought of this, but the main problem is still knowing when the keyboard is about to be displayed. For example, focus could change (lose focus) because the keyboard gets displayed, OR focus could chance (lose focus) because another EditText was tapped.

I was gonna say check if keyboard is showing in the focuschanged but investigating a little, it's not as simple as might think:

You could do it the other way, create an unique OnFocusChangedListener myListener and set it to all your EditTexts and put a switch inside and store which is the last view getting/losing focus