0

My app has a navigation drawer and contains some edittext fields in fragments. I was trying to add AdView in my activity_main.xml by the below xml code. The AdView floats when Keyboard is enabled, stays ontop of keyboard. I've added windowSoftInputMode="adjustResize" on Menifest and even tried getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN); in OnCreate() method in activity class but both didn't help. Any ideas to fix this? Here is my activity_main.xml layout.

<android.support.v4.widget.DrawerLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/drawer_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.neupanedinesh.farefindernepal.MainActivity">

    <android.support.design.widget.NavigationView
        android:id="@+id/navigation_view"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        app:headerLayout="@layout/navigation_header"
        app:menu="@menu/navigation_menu"/>


    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <FrameLayout
            android:id="@+id/fragment_container"
            android:layout_width="match_parent"
            android:layout_height="match_parent"/>

        <com.google.android.gms.ads.AdView
            xmlns:ads="http://schemas.android.com/apk/res-auto"
            android:id="@+id/adView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerHorizontal="true"
            android:layout_alignParentBottom="true"
            ads:adSize="BANNER"
            ads:adUnitId="KEY">
        </com.google.android.gms.ads.AdView>

    </RelativeLayout>

</android.support.v4.widget.DrawerLayout>
Dinesh
  • 23
  • 1
  • 6
  • Possible duplicate of [Android: How do I prevent the soft keyboard from pushing my view up?](https://stackoverflow.com/questions/4207880/android-how-do-i-prevent-the-soft-keyboard-from-pushing-my-view-up) –  Sep 21 '17 at 11:28
  • @MehulKanzariya I tried these all still the same problem. – Dinesh Sep 21 '17 at 12:15

1 Answers1

0

None of the answers worked for me but this,

android:windowSoftInputMode="adjustNothing"
Himeshgiri gosvami
  • 2,559
  • 4
  • 16
  • 28