title: push button above keyboard
body: <p>I have an EditText and a button and some other TextViews in a fragment layout.The parent of the layout is Constraint Layout and the activity that holds it is a Relative layout. When the layout is displayed the keyboard is displayed but I want the button to be pushed above the keyboard.I gave the the attribute <strong>android:windowSoftInputMode="adjustResize"</strong> to the manifest file in the activity that holds the fragment layout.Still did not help me!!I have referred to one of the following links <a href="https://stackoverflow.com/questions/47751094/android-button-above-keyboard">Link1</a>, <a href="https://stackoverflow.com/questions/15323758/android-how-to-push-button-above-soft-keyboard">Link2</a>, bu the answers did not help me...</p>
  
  <p>Manifest:</p>
  
  <pre><code>&lt;activity android:name=".Otp.Otp"
              android:windowSoftInputMode="adjustResize"
              android:screenOrientation="portrait"/&gt;
  </code></pre>
  
  <p>Activity Layout:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout 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/relativeLayout"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      &gt;
      &lt;ImageView
          android:id="@+id/otp_splash"
          android:layout_width="match_parent"
          android:scaleType="matrix"
          android:layout_height="match_parent"
          android:adjustViewBounds="true"
          android:background="@drawable/masked_splash"&gt;
      &lt;/ImageView&gt;
      &lt;ImageView
          android:layout_width="@dimen/intro_logo_wdth"
          android:layout_height="@dimen/intro_logo_hght"
          android:background="@drawable/splash_logo"
          android:layout_centerHorizontal="true"
          android:id="@+id/msked_splsh_logo"
          android:layout_marginTop="50dp"/&gt;
      &lt;RelativeLayout
          android:id="@+id/otp_lyt"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:background="#ffffff"
          android:layout_below="@+id/msked_splsh_logo"
          android:layout_marginTop="45dp"&gt;
      &lt;/RelativeLayout&gt;
      &lt;ImageView
      android:layout_width="20dp"
      android:layout_height="20dp"
      android:layout_alignParentRight="true"
      android:layout_margin="8dp"
      android:background="@drawable/close"
          android:layout_alignParentEnd="true" /&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p><strong>Note:</strong>
  In the above layout <strong>@+id/otp_lyt</strong> is the id where fragment is fragment is loaded.</p>
  
  <p>Fragment_Layout:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;layout
      xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tools"
      xmlns:android="http://schemas.android.com/apk/res/android"&gt;
  &lt;android.support.constraint.ConstraintLayout
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:background="#ffffff"&gt;
      &lt;TextView
          android:id="@+id/head"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_margin="@dimen/ph_verify_lbl_mrgn"
          android:text="@string/verify_your_phone_number"
          android:textColor="#bb2b67"
  
          android:textSize="@dimen/ph_verify_head_tsxtsze"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toTopOf="parent" /&gt;
      &lt;TextView
          android:id="@+id/textView"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_marginLeft="8dp"
          android:layout_marginStart="8dp"
          android:layout_marginTop="4dp"
          android:text="@string/lorem_ipsum_lorem_ipsum"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintHorizontal_bias="0.0"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toBottomOf="@+id/head" /&gt;
      &lt;EditText
          android:id="@+id/phnmbr"
          android:layout_width="match_parent"
          android:layout_height="60dp"
          android:layout_marginEnd="10dp"
          android:focusable="true"
          android:fitsSystemWindows="true"
          android:focusableInTouchMode="true"
          android:background="@drawable/edt_txt_bg"
          android:layout_marginLeft="10dp"
          android:layout_marginRight="10dp"
          android:layout_marginStart="10dp"
          android:layout_marginTop="8dp"
          android:hint="@string/ph_hint"
          android:inputType="number"
          android:textSize="@dimen/ph_verify_head_tsxtsze"
          android:paddingTop="40dp"
          android:paddingLeft="10dp"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintHorizontal_bias="0.0"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toBottomOf="@+id/textView" /&gt;
          &lt;Button
          android:id="@+id/next"
          android:layout_width="match_parent"
          android:layout_height="65dp"
          android:background="@drawable/button_bg"
          android:text="@string/next"
          android:textColor="#ffffff"
          android:textSize="22sp"
          app:layout_constraintBottom_toBottomOf="parent"
          app:layout_constraintRight_toRightOf="parent"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toTopOf="parent"
          app:layout_constraintVertical_bias="1.0" /&gt;
      &lt;ImageView
          android:id="@+id/imageView"
          android:layout_width="20dp"
          android:layout_height="25dp"
          android:elevation="2dp"
          android:layout_alignParentEnd="true"
          android:layout_alignParentRight="true"
          android:layout_centerVertical="true"
          android:layout_marginBottom="8dp"
          android:layout_marginEnd="8dp"
          android:layout_marginLeft="8dp"
          android:layout_marginRight="8dp"
          android:layout_marginStart="8dp"
          android:background="@drawable/arrow"
          app:layout_constraintBottom_toBottomOf="@+id/next"
          app:layout_constraintEnd_toEndOf="@+id/next"
          app:layout_constraintHorizontal_bias="0.909"
          app:layout_constraintStart_toStartOf="@+id/next"
          app:layout_constraintTop_toTopOf="@+id/next"
          app:layout_constraintVertical_bias="0.571" /&gt;
  &lt;/android.support.constraint.ConstraintLayout&gt;
  &lt;/layout&gt;
  </code></pre>
  
  <p>Screenshot1:</p>
  
  <p><a href="https://i.stack.imgur.com/7Ww9F.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7Ww9F.png" alt="enter image description here"></a></p>
  
  <p>Screenshot2:</p>
  
  <p><a href="https://i.stack.imgur.com/DQ2bQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DQ2bQ.png" alt="enter image description here"></a></p>
  
  <p>TEST:
  Activity layout:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout 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:layout_width="match_parent"
      android:layout_height="match_parent"
      tools:context=".MainActivity"&gt;
  
  &lt;RelativeLayout
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:id="@+id/container"
      android:layout_marginTop="100dp"
      android:fitsSystemWindows="true"&gt;
  
  &lt;/RelativeLayout&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>Fragment layout:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent" android:layout_height="match_parent"&gt;
  
      &lt;EditText
          android:id="@+id/editText"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentTop="true"
          android:layout_centerHorizontal="true"
          android:layout_marginTop="114dp"
          android:ems="10"
          android:focusable="true"
          android:fitsSystemWindows="true"
          android:inputType="textEmailAddress" /&gt;
  
      &lt;Button
          android:id="@+id/button"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentBottom="true"
          android:layout_centerHorizontal="true"
          android:text="Button" /&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>Manifest:</p>
  
  <pre><code> &lt;activity android:name=".MainActivity"
                      android:windowSoftInputMode="adjustResize|adjustPan"&gt;
                      &lt;intent-filter&gt;
                          &lt;action android:name="android.intent.action.MAIN" /&gt;
  
                          &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
                      &lt;/intent-filter&gt;
                  &lt;/activity&gt;
  </code></pre>