Search code examples
androidandroid-keypad

Avoid Keyboard Pull Activity Layout when shown android


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" />

Solution

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

    this could help

    better look at hereenter link description here