My problem: starting from the second time the software keyboard is shown on the screen, it entirely hides my EditText.
Attribute android:windowSoftInputMode=\"adjus
The problem you're experiencing is now a known platform bug as described here: https://code.google.com/p/android/issues/detail?id=182191
The fix is not backported and so will not take effect until Android N. Until Android N is your minimum SDK, the following solution is a workaround.
You can create a custom class extending EditText and override the method onKeyPreIme(int keyCode, KeyEvent event) like this:
@Override
public boolean onKeyPreIme(int keyCode, KeyEvent event)
{
if(keyCode == KeyEvent.KEYCODE_BACK)
{
clearFocus();
}
return super.onKeyPreIme(keyCode, event);
}
You should also ensure a higher level layout has the ability to be focused so the EditText's focus may be cleared successfully. The following attributes may work for you:
android:descendantFocusability="beforeDescendants"
android:focusableInTouchMode="true"
Now when the back key is pressed, the EditText loses the focus. Then when you tap the button again, adjustpan will work as intended. (Posting as an answer since the edit was refused.)