1

Tried using window?.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN)
inside the activity.Also tried with ADJUST_RESIZE Param It was not working.

The following code is my manifest for the activity

<activity android:name=".auth.AuthActivity"
          android:theme="@style/NoActionBarTheme"
          android:windowSoftInputMode="adjustResize|stateHidden">
</activity>

This is my emulator screenshot

Emulator screen Shot
Tried most of the solutions .May be I am missing the right one

Abraham Mathew
  • 2,029
  • 3
  • 21
  • 42

4 Answers4

0

you can hide keyboard programmatically when you set error on editBox

 public void hideKeyboard() {
        View view = this.getCurrentFocus();
        if (view != null) {
            InputMethodManager imm = (InputMethodManager)
                    getSystemService(Context.INPUT_METHOD_SERVICE);
            if (imm != null) {
                imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
            }
        }
    }
Priyanka
  • 3,369
  • 1
  • 10
  • 33
0

Use the ScrollView in the layout and put all your fields in ScrollView so they can move vertically. Then when the Keyboard pops out the fields can move easily and nothing will be hidden.

Abdur Rahman
  • 894
  • 1
  • 11
  • 27
0

Use this it working code

put this code on create

        getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE|WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);

put manifest this

  android:windowSoftInputMode="adjustResize"
mehul chauhan
  • 1,792
  • 11
  • 26
0

Try like this

<ScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent" >


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


        <EditText
            android:id="@+id/edittext1"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="player1"
            android:layout_marginTop="10dp"/>

        <EditText
            android:id="@+id/edittext2"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="10dp"
            android:hint="player2"/>

        <EditText
            android:id="@+id/edittext3"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="10dp"
            android:hint="player3"/>


        <EditText
            android:id="@+id/edittext4"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="player4"
            android:layout_marginTop="10dp" />
    </LinearLayout>

</ScrollView>