Developer Tip: Managing the Android Soft Keyboard

0 Flares 0 Flares ×

The Android soft keyboard will display when an input field, such as textField, is in focus (e.g. a finger touch in the textField is sensed by the device). Normally, this is the behavior we want.

However, what if the first screen of your app is a login screen? Then we may not want the keyboard to launch as it may obscure information on the screen that we want the user to see before logging in.

Android Keyboard

In this case, the reason the keyboard launches immediately is because in the screen above, the textField is the first focusable field on the screen and that is where the focus will be.

If we want to keep the soft keyboard hidden, then we can set the windowSoftInputMode property of the Window to Titanium.UI.Android.SOFT_INPUT_STATE_HIDDEN as follows:

'Window[platform=android]': {
    windowSoftInputMode: Titanium.UI.Android.SOFT_INPUT_STATE_HIDDEN

Then we will get the desired behavior.

Android Keyboard 2

0 Flares Twitter 0 Facebook 0 LinkedIn 0 Email -- 0 Flares ×


  1. I am no longer able to get a keyboard to pop up in android apps. Anyone else experience this?

    • 63ek

      Basically Android show a keyboard by default when an application screen contains a textField. It is not convenient for the login page.

      • Leor

        63ek – correct but it also applies to other types of screens like a form with an input field on top. Really anytime the user is presented with a keyboard and you don’t want it displayed by default

    • Leor

      Harrington, on device or in simulator? Did it work before you set this property? You can always revert by removing the property setting.

Comments are closed.

Sign up for our blog!

computer and tablet showing Appcelerator software
Start free, grow from there.
0 Flares Twitter 0 Facebook 0 LinkedIn 0 Email -- 0 Flares ×