I have a vertical sliding drawer at the bottom of my app. When the soft keyboard opens, it pushes the tab for the drawer up, so it sits atop the keyboard. I actually want it
android:windowSoftInputMode="stateHidden|adjustNothing"
This code works.
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
This one is working for me.
@manifest in your activity:
android:windowSoftInputMode="stateAlwaysHidden|adjustPan"
In my case I needed the keyboard to stay hidden and just after the click of the button my layout needs to be adjusted, so I just added this command in the manifest and it got super right.
android:windowSoftInputMode="stateHidden|adjustResize"