How to keep the toolbar fixed at the top when soft keyboard is appears
<p>I have created a chat application. I have attached the screenshots. When the keyboard is active the toolbar is not visible. i have tried various solution on stack overflow and other websites but nothing seems to work for me. I have attached the code. Please help.
1.layout code:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;android.support.design.widget.CoordinatorLayout
    android:id="@+id/main_content"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"&gt;
    &lt;RelativeLayout
        android:id="@+id/layout_chat_container"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        tools:ignore="RtlHardcoded"
        android:layout_gravity="bottom"
        android:isScrollContainer="false"
        android:background="@color/newColor2"&gt;

        &lt;include
            android:id="@+id/app_bar"
            layout="@layout/toolbar"
            android:layout_width="match_parent"
            android:layout_height="@dimen/toolbar_height" /&gt;
        &lt;se.emilsjolander.stickylistheaders.StickyListHeadersListView
            android:id="@+id/list_chat_messages"
            style="@style/ListViewWithoutDividerStyle"
            android:listSelector="@android:color/transparent"
            android:fastScrollEnabled="true" /&gt;
        &lt;ProgressBar
            android:id="@+id/progress_chat"
            style="@style/CenterProgressBarStyle"
            android:visibility="gone" /&gt;

        &lt;LinearLayout
            android:id="@+id/layout_attachment_preview_container"
            android:layout_height="match_parent"
            android:layout_width="match_parent"
            android:layout_alignParentEnd="true"
            android:layout_alignParentRight="true"
            android:layout_above="@+id/layout_chat_send_container"
            android:background="@color/colorPrimary"
            android:orientation="vertical"
            android:visibility="gone"&gt;
            &lt;View
                android:id="@+id/divider_chat_attachments"
                style="@style/HorizontalDividerStyle" /&gt;

            &lt;com.flock.android.quickblox.chat.ui.widget.AttachmentPreviewAdapterView
                android:id="@+id/adapter_view_attachment_preview"
                style="@style/MatchWidth" /&gt;
        &lt;/LinearLayout&gt;
        &lt;View
            android:id="@+id/divider_chat"
            style="@style/HorizontalDividerStyle"
            android:layout_above="@+id/layout_chat_send_container" /&gt;
        &lt;LinearLayout
            android:id="@+id/layout_chat_send_container"
            style="@style/MatchWidth"
            android:layout_alignParentBottom="true"
            android:background="@color/colorPrimary"
            android:orientation="horizontal"&gt;
            &lt;ImageButton
                android:id="@+id/button_chat_attachment"
                style="@style/BorderlessImageButtonStyle"
                android:contentDescription="@null"
                android:layout_gravity="center_vertical"
                android:onClick="onAttachmentsClick"
                android:src="@mipmap/ic_action_attachment"
                android:visibility="gone" /&gt;
            &lt;EditText
                android:id="@+id/edit_chat_message"
                style="@style/WeightWidth"
                android:layout_height="wrap_content"
                android:hint="@string/chat_edit_text_hint"
                android:scrollHorizontally="false"
                android:textColorHint="@color/colorActionMode"
                android:inputType="textShortMessage|textMultiLine|textCapSentences"
                android:maxLength="1024"
                android:textColor="@color/white"
                android:layout_marginLeft="@dimen/view_margin_small"
                android:singleLine="false" /&gt;
            &lt;ImageButton
                android:id="@+id/button_chat_send"
                style="@style/BorderlessImageButtonStyle"
                android:contentDescription="@null"
                android:layout_gravity="center_vertical"
                android:onClick="onSendChatClick"
                android:src="@mipmap/ic_sent"
                android:text="@string/chat_send" /&gt;
        &lt;/LinearLayout&gt;
    &lt;/RelativeLayout&gt;
&lt;/android.support.design.widget.CoordinatorLayout&gt; 
</code></pre>

<p>2.Screenshots:<br>
<a href="https://i.stack.imgur.com/tMjPXl.png" rel="noreferrer"><img src="https://i.stack.imgur.com/tMjPXl.png" alt="Before"></a>
<a href="https://i.stack.imgur.com/6luZBl.png" rel="noreferrer"><img src="https://i.stack.imgur.com/6luZBl.png" alt="After"></a></p>