I have a `mainActivity` has 2 `Fragments`.

The `mainActivity` has `AppBar` contains a `Toolbar`.

One of those `Fragments` has 2 `EditTexts`.

[image 1](https://i.stack.imgur.com/SEMPX.jpg)

when I click on one of those `EditText` the keyboard appears

[image 2](https://i.stack.imgur.com/VPrER.png)

but as you see the `Toolbar` (with the 2 images on it) disappears.

even I move down the keyboard it still like this

[image 3](https://i.stack.imgur.com/bOSxD.png)

I try to add 

```
android:windowSoftInputMode="adjustPan" 

```

to my `MainActivity` in `Manifest` but it still doesn't work.

and I try to add 

```
getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);

```

to the `onCreateView` of the fragment, but it still doesn't work.

Please, any help to make the app bar appears even the keyboard appears.

I'm sorry for my bad English.

**activity\_main xml:**

```
<android.support.design.widget.CoordinatorLayout 
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/main_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context="com.example.lenovo.myapplication.MainActivity">

<android.support.v4.view.ViewPager
    android:id="@+id/container"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:layout_behavior="@string/appbar_scrolling_view_behavior" />

<android.support.design.widget.FloatingActionButton
    android:id="@+id/fab"
    android:layout_width="0dp"
    android:layout_height="0dp" />

<android.support.design.widget.AppBarLayout
    android:id="@+id/appbar"
    android:layout_width="match_parent"
    android:layout_height="230dp"

android:background="@android:drawable/screen_background_light_transparent"
    android:gravity="top">

    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="185dp"
        android:background="@drawable/pic"
        android:gravity="top"
        android:weightSum="1"
        app:layout_scrollFlags="scroll|enterAlways">

        <ImageView
            android:id="@+id/btn_exit"
            android:layout_width="wrap_content"
            android:layout_height="25dp"
            android:layout_gravity="right"
            android:layout_weight="0.29"
            android:background="@drawable/exit" />

        <ImageView
            android:layout_width="60dp"
            android:layout_height="59dp"
            android:layout_alignParentLeft="true"
            android:layout_gravity="top|left"
            android:layout_weight="0.38"
            android:background="@drawable/logo" />
    </android.support.v7.widget.Toolbar>

    <android.support.design.widget.TabLayout
        android:id="@+id/tabs"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@android:color/transparent" />
  </android.support.design.widget.AppBarLayout>
</android.support.design.widget.CoordinatorLayout>

```

**mon\_compte fragment xml:**

```
<android.support.constraint.ConstraintLayout 
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="wrap_content"
android:layout_height="wrap_content"

tools:context="com.example.lenovo.myapplication.
MainActivity$PlaceholderFragment">

<LinearLayout
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:orientation="vertical">

    <LinearLayout
        android:layout_width="368dp"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        tools:layout_editor_absoluteX="8dp"
        tools:layout_editor_absoluteY="8dp">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            tools:layout_editor_absoluteX="8dp"
            tools:layout_editor_absoluteY="8dp">

            <EditText
                android:id="@+id/txt_email"
                android:layout_width="275dp"
                android:layout_height="wrap_content"
                android:layout_gravity="center_horizontal"
                android:drawableLeft="@drawable/ic_email"
                android:ems="10"
                android:hint=" Votre E-mail"
                android:inputType="textPersonName"
                android:visibility="visible" />

            <EditText
                android:id="@+id/txt_mdp"
                android:layout_width="275dp"
                android:layout_height="wrap_content"
                android:layout_gravity="center_horizontal"
                android:drawableLeft="@drawable/ic_lock"
                android:ems="10"
                android:hint=" Mot de passe"
                android:inputType="textPassword"
                android:password="true"
                android:visibility="visible" />

            <Button
                android:id="@+id/btn_enter"
                android:layout_width="275dp"
                android:layout_height="25dp"
                android:layout_gravity="center_horizontal"
                android:layout_marginTop="5dp"
                android:background="@drawable/conexbtn"
                android:text="Connexion"
                android:textAllCaps="false"
                android:textColor="@android:color/background_light"
                android:visibility="visible" />

            <com.facebook.login.widget.LoginButton
                android:id="@+id/btn_face"
                android:layout_width="275dp"
                android:layout_height="wrap_content"
                android:layout_gravity="center_horizontal"
                android:layout_marginTop="10dp"
                android:background="@drawable/facebtn"
                android:text="Se connecter avec Facebook"
                android:textAllCaps="false"
                android:textColor="@android:color/background_light"
                android:visibility="visible" />

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="5dp"
                android:orientation="horizontal"
                tools:layout_editor_absoluteX="17dp"
                tools:layout_editor_absoluteY="258dp">

                <Button
                    android:id="@+id/btn_mdpo"
                    style="?android:attr/borderlessButtonStyle"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="0.18"
                    android:backgroundTint="@android:color/transparent"
                    android:onClick="btn_mdpo"
                    android:paddingLeft="50dp"
                    android:text="Mot de passe oublié?"
                    android:textAllCaps="false"
                    android:textColor="#bfbfbf"
                    android:textSize="13sp" />

                <Button
                    android:id="@+id/btn_i"
                    style="?android:attr/borderlessButtonStyle"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="0.18"
                    android:backgroundTint="@android:color/transparent"
                    android:onClick="btn_i"
                    android:paddingRight="50dp"
                    android:text="Nouveau sur wach?"
                    android:textAllCaps="false"
                    android:textColor="#bfbfbf"
                    android:textSize="13sp" />
            </LinearLayout>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="200dp"
                android:orientation="vertical">

                <Button
                    android:id="@+id/btn_sht"
                    style="?android:attr/borderlessButtonStyle"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="bottom|right"
                    android:layout_weight="0.18"
                    android:backgroundTint="@android:color/transparent"
                    android:onClick="btn_sht"
                    android:paddingRight="50dp"
                    android:text="by Soft High Tech"
                    android:textAllCaps="false"
                    android:textColor="#000000"
                    android:textSize="14sp" />
            </LinearLayout>
        </LinearLayout>
      </LinearLayout>
   </LinearLayout>
</android.support.constraint.ConstraintLayout>

```