title: Android: Scroll down ListView, when keyboard opens
body: <p>I have the following 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:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      tools:context="de.blabla.bla.MessageActivity"&gt;
  
      &lt;LinearLayout
          android:orientation="vertical"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:background="@color/mytheme_dark"&gt;
  
          &lt;ListView
              android:layout_width="fill_parent"
              android:layout_height="fill_parent"
              android:id="@+id/listView2"
              android:layout_marginBottom="50dp"
              android:dividerHeight="0dp"
              android:divider="@null" /&gt;
  
          &lt;LinearLayout
              android:orientation="horizontal"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:layout_marginTop="-50dp"&gt;
  
              &lt;EditText
                  android:layout_width="fill_parent"
                  android:layout_height="match_parent"
                  android:id="@+id/messageInput"
                  android:background="#9f7348"
                  android:layout_marginRight="65dp"
                  android:paddingLeft="5dp" /&gt;
  
              &lt;Button
                  style="?android:attr/buttonStyleSmall"
                  android:layout_width="fill_parent"
                  android:layout_height="match_parent"
                  android:text="Send"
                  android:id="@+id/sendButton"
                  android:background="@color/mytheme_color"
                  android:layout_marginLeft="-65dp" /&gt;
          &lt;/LinearLayout&gt;
      &lt;/LinearLayout&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>It shows a Listview and a text input-field below. If I press on the text input-field, the keyboard opens and covers some listview elements. I want to scroll the listview down, when the keyboard opens. How can I do that?</p>
  
  <p><strong>EDIT:</strong>
  When doing, what the answers say, it works except that the keyboard half overlapst the inputfield. See the pic:</p>
  
  <p><a href="https://i.stack.imgur.com/EZ0hL.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EZ0hL.jpg" alt="enter image description here"></a><a href="https://i.stack.imgur.com/OX5Q1.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OX5Q1.jpg" alt="enter image description here"></a></p>