Question

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" />
Was it helpful?

Solution 2

InputMethodManager imm = (InputMethodManager)getSystemService(
      Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(myEditText.getWindowToken(), 0);

this could help

better look at hereenter link description here

OTHER TIPS

i think u should change in manifiest

<activity android:name=".yourActivity"
        android:windowSoftInputMode="adjustResize|adjustPan">

Please refer this link, re-sizing the app

  <activity android:name=".TodoEdit"
        android:windowSoftInputMode="adjustResize">
<activity 
  android:name="Tollywood"
  android:screenOrientation="portrait"
  android:windowSoftInputMode="stateHidden"></activity>

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top