Android windowSoftInputMode – Resize the application for the soft-keyboard

Android has the so-called Input Method Framework to support different input methods, e.g. keyboard, soft-keyboard, handwriting etc. If the soft-keyboard is used it is diplayed at the bottom of the screen once the user select an text view to edit it.

This way it may overlay other views as Android scrolls the application window so that the selected view is visible and shows the soft-keyboard. This approach is called “pan and scan” and is the default behavior in Android.

An example this may be your input window.

If you select the summary field the result may look like the following. “pan and scan” overlays the button.

You can change this behavior to “resize”. If your application has enough space the layout would be adjusted to show all views together with the keyboard. In our case the result would look like the following.

To change the mode to “resize” at the following statement to your activity in “”.

<activity android:name=".TodoEdit"

I hope this helps. For more info please see Android Tutorial. Can can also follow me on Twitter.

About Lars Vogel

Lars Vogel is the founder and CEO of the vogella GmbH and works as Eclipse and Android consultant, trainer and book author. He is a regular speaker at international conferences, With more than one million visitors per month his website is one of the central sources for Eclipse and Android programming information.
This entry was posted in Android. Bookmark the permalink.