3

In the layout file of one of my activities I've got 2 inputs at the top and at the bottom and a next button.

The problem is, when keyboard shows, it covers the button. How can I bring the views above keyboard?

Sergey Glotov
  • 20,200
  • 11
  • 84
  • 98
naivd
  • 65
  • 5
  • 3
    search on google . – IntelliJ Amiya Jun 30 '16 at 05:58
  • Related: http://stackoverflow.com/questions/1109022/close-hide-the-android-soft-keyboard and http://stackoverflow.com/questions/2150078/how-to-check-visibility-of-software-keyboard-in-android – cf- Jun 30 '16 at 05:59
  • 1
    Also related, perhaps even a duplicate: http://stackoverflow.com/questions/9111813/how-to-move-the-layout-up-when-the-soft-keyboard-is-shown-android – cf- Jun 30 '16 at 05:59
  • This answer might be what you are asking to do. http://stackoverflow.com/questions/3995825/what-does-androidlayout-weight-mean – Meshugah Jun 30 '16 at 06:34

2 Answers2

4

Check this blog post On-screen Input Methods

You can use android:windowSoftInputMode attribute to specify what should happen whether the layout is resized or whether it scrolls.

In your manifest file

<activity name=".YourActivity"
        android:windowSoftInputMode="stateVisible|adjustResize">
        ...
</activity>

Related questions:

Move layouts up when soft keyboard is shown?

Push up content when clicking in edit text

Android: How do I prevent the soft keyboard from pushing my view up?

How to move the layout up when the soft keyboard is shown android

How to check visibility of software keyboard in Android?

Community
  • 1
  • 1
0

Just put in manifest.. Use "adjustResize"

It makes main window always resized to make room for the soft keyboard on screen.

<application
......
>
<activity
           .............................
            android:windowSoftInputMode="stateAlwaysHidden|adjustResize" />

 </application>
Kush
  • 1,080
  • 11
  • 15