Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: how to add custom soft keyboard when form field is selected in WebView

I am using WebView to present UI. Is there any way that I can trigger custom soft keyboard when input text form field is selected?

like image 551
Perun Avatar asked Jun 23 '10 00:06

Perun


2 Answers

I just encounter a similar problem with the android WebView. When I select, in touch mode, a text input field, it does not pop-up the virtual keyboard whereas with the trackball it works fine.

I just found there: http://groups.google.com/group/android-developers/browse_thread/thread/e52109afda599301/b4cbc16e4e9e8e0d (last message from alien9) that calling

myWebview.requestFocusFromTouch(); 

solve the problem.

like image 107
ol_v_er Avatar answered Oct 20 '22 11:10

ol_v_er


take a look at HTML5 - if you change your

<input type="text" ...

to for instance a

<input type="number" ...

you'll get a specialized soft keyboard for numbers.

Here is some more documentation: http://diveintohtml5.ep.io/forms.html

like image 31
rdmueller Avatar answered Oct 20 '22 09:10

rdmueller