title: Soft Keyboard Hides Actionbar
body: <p>I have a simple activity with a text view followed by two edit texts. When I start typing, the soft keyboard pushes layout up and hides the action bar, and I won't be able to select/copy/paste text.</p>
  
  <p><strong>My activity looks like this:</strong>  </p>
  
  <p><a href="https://i.stack.imgur.com/HEJM1m.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HEJM1m.png" alt="Normal activity view"></a></p>
  
  <p>When I start typing, the action bar gets hidden, like this - and more importantly, note that the normal copy paste bar is missing even though a text is highlighted:</p>
  
  <p><a href="https://i.stack.imgur.com/DfOWGm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DfOWGm.png" alt="Missing action bar and the copy/paste bar"></a></p>
  
  <p>What can I do to make sure the action bar does not hide?</p>
  
  <ul>
  <li>I have tried some other tips from SO (such as using scroll view) but none worked. </li>
  <li>The app is created using Android Studio 1.4.1 wizard with the Drawer Activity. </li>
  <li><p>In my activity manifest I am using adjustPan. I do not want to use adjustResize.</p>
  
  <p><code>android:windowSoftInputMode="stateAlwaysHidden|adjustPan"</code></p></li>
  </ul>
  
  <p><strong>My activity is here:</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;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/navigation_drawer_layout"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:fitsSystemWindows="true"
      tools:openDrawer="start"&gt;
  
      &lt;android.support.design.widget.CoordinatorLayout
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:fitsSystemWindows="true"
          tools:context=".MainActivity"&gt;
  
          &lt;android.support.design.widget.AppBarLayout
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:theme="@style/app_theme.app_bar_overlay"&gt;
  
              &lt;android.support.v7.widget.Toolbar
                  android:id="@+id/toolbar"
                  android:layout_width="match_parent"
                  android:layout_height="?attr/actionBarSize"
                  android:background="?attr/colorPrimary"
                  app:popupTheme="@style/app_theme.popup_overlay" /&gt;
  
          &lt;/android.support.design.widget.AppBarLayout&gt;
  
          &lt;LinearLayout 
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:layout_margin="@dimen/activity_margin"
              android:fillViewport="true"
              android:orientation="vertical"
              app:layout_behavior="@string/appbar_scrolling_view_behavior"&gt;
  
              &lt;TextView
                  android:layout_width="match_parent"
                  android:layout_height="match_parent"
                  android:layout_weight="0.5"
                  android:background="@android:color/darker_gray"
                  android:text="My holiday story here." /&gt;
  
              &lt;View
                  android:layout_width="match_parent"
                  android:layout_height="@dimen/activity_margin" /&gt;
  
              &lt;EditText
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:layout_marginBottom="@dimen/gap_normal"
                  android:gravity="top"
                  android:text="My Holiday in Europe" /&gt;
  
              &lt;EditText
                  android:layout_width="match_parent"
                  android:layout_height="match_parent"
                  android:layout_weight="0.5"
                  android:gravity="top"
                  android:text="My holiday story is blah blah blah blah blah blah blah blah blah..." /&gt;
  
          &lt;/LinearLayout&gt;
  
  
      &lt;/android.support.design.widget.CoordinatorLayout&gt;
  
      &lt;com.magicparcel.app.mysampleapp.ui.CustomNavigationView
          android:id="@+id/navigation_view"
          android:layout_width="wrap_content"
          android:layout_height="match_parent"
          android:layout_gravity="start"
          android:fitsSystemWindows="true"
          app:headerLayout="@layout/navigation_drawer_header"
          app:itemIconTint="@color/app_grey_500"
          app:menu="@menu/drawer_main" /&gt;
  
  &lt;/android.support.v4.widget.DrawerLayout&gt;
  </code></pre>