1

When i focus on edittext in my application the keyboard open and push my activity layout above the keyboard. The only option i have is to check if the keyboard is open then make the buttons that is pulled above keyboard invisible. I wonder if there is a simple way to disable the layout to get pulled up because this is a common error in every application i build. Also can someone tell me how to check when the keyboard is shown or hide. thanks.

Updates : From my manifest

    <activity  android:name=".Defi"  android:screenOrientation="portrait" android:theme="@style/Theme.Transparent"   android:configChanges="keyboardHidden|orientation|screenSize" />
Dimitri
  • 659
  • 3
  • 18
  • 46

5 Answers5

2

i think u should change in manifiest

<activity android:name=".yourActivity"
        android:windowSoftInputMode="adjustResize|adjustPan">
Hardik Nadiyapara
  • 2,406
  • 2
  • 14
  • 24
1
InputMethodManager imm = (InputMethodManager)getSystemService(
      Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(myEditText.getWindowToken(), 0);

this could help

better look at hereenter link description here

Community
  • 1
  • 1
Kishor datta gupta
  • 1,083
  • 2
  • 13
  • 41
0

Please refer this link, re-sizing the app

  <activity android:name=".TodoEdit"
        android:windowSoftInputMode="adjustResize">
Rahul Upadhyay
  • 3,297
  • 2
  • 19
  • 36
0
<activity 
  android:name="Tollywood"
  android:screenOrientation="portrait"
  android:windowSoftInputMode="stateHidden"></activity>
hm7
  • 1
  • 1
0

Try to put this in you manifest :

 <activity
       android:name=".MainActivity"
       android:configChanges="keyboardHidden|orientation|screenSize" >
 </activity>

This will help you and wont pull layout up and also useful in handling configuration change when activity is transferred from Portrait mode to Landscape mode.

Rahil2952
  • 1,980
  • 13
  • 25