2

I'm making a website for Android devices and I'd like the keyboard to pop up automatically. I have a javascript that focuses on a text field and I see the cursor but the keyboard doesn't pop up until I tap the screen.

Is there a way to make it work from the html/JS?

Assaf Levy
  • 1,312
  • 1
  • 12
  • 20
  • You should take a look at this: http://stackoverflow.com/questions/2403632/android-show-soft-keyboard-automatically-when-focus-is-on-an-edittext –  Aug 07 '12 at 10:00

1 Answers1

2
// create dialog
final AlertDialog dialog = ...; 

// request keyboard   
dialog.getWindow().setSoftInputMode (WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);

This works for me.