Hiding ‘Bottom Navigation Bar’ whilst keyboard is present - Android

Solution 1:

The easiest implementation, Add AndroidManifest.xml in

<activity android:windowSoftInputMode="adjustPan"/>

hopefully this helps someone out. Enjoy !

Solution 2:

you just add this code in your manifest like this way..

 <activity android:name=".MainActivity"
        android:windowSoftInputMode="adjustPan">

this works for me.. happy coding

Solution 3:

I ended up using the height measuring method that seems to be the standard way of soft keyboard detection which is described in this answer. However, I used this library's implementation of it, as it is still the same ViewTreeObserver.OnGlobalLayoutListener method, implemented well, and allowed me to abstract the code out of my applications main codebase.

When this keyboard visibility listener is triggered, I then hide/show the bottom navigation bar (which I have explained here).

Solution 4:

Add this line in onResume() of your Activity or Fragment.

getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_NOTHING);

It is worked for me. Just try it once.

Solution 5:

Just add the attribute below to every activity in your AndroidManifest.xml file.

<activity
    android:name=".MainActivity"
    android:windowSoftInputMode="stateAlwaysHidden|adjustPan" />