Webview android keyboard does not appear for a long time to enter values

I have an Android 3.0 application with WebView inside. Web browsing opens a website that uses a java script. Opening a site works great. But whenever I click on TextField, the keyboard does not appear.

I already tried: The soft keyboard does not appear in the click form field in WebView

but without success. The keyboard seems very short and then disappears. From my point of view this is caused by some javascript. This is the html of one of the input fields:

<input id="ToolbarOkCode" class="urEdf2TxtEnbl" type="Text" style="text-align:;width:150px;" value="" name="ToolbarOkCode" lsevents="{'Change':[{'ClientAction':'none'},{'type':'TOOLBARINPUTFIELD'}],'Enter':[{'ClientAction':'submit','PrepareScript':'return its.XControlSubmit();','ResponseData':'delta','TransportMethod':'partial'},{'type':'TOOLBARINPUTFIELD','~XRequest':'X'}]}" lsdata="{0:'',1:'',2:'',3:20,4:200,5:false,6:false,7:true,8:false,9:false,10:'STRING',11:'F4LOOKUP',12:'150px',13:'LEFT',14:false,15:'',16:false,17:false,18:false,19:'AUTO',20:true,21:'NONE',22:'MM/dd/yyyy',23:false,24:'',25:'',26:false,27:false,28:'',29:'NORMAL',30:1,31:false,32:0,33:0}" ct="I" autocomplete="off" ti="0" tabindex="0" maxlength="200"> 
+8
android android-softkeyboard webview
source share
2 answers

I found a solution for my problem. This is pretty specific, but I hope someday it helps someone ...

I expanded WebViewClient and tried several of my functions. my question started when I loaded the javascript: pacification javascript: onto onLoadResource() . For some reason, this caused all keyboard inoperability. I moved the script to onPageFinished() , and the WebView is working fine again.

+5
source share

I used your code and then try to run on Android 2.2. It works great and shows a keyboard for entering values. I am posting the complete code that I am running

  String str="<input id=\"ToolbarOkCode\" class=\"urEdf2TxtEnbl\" type=\"Text\" style=\"text-align:;width:150px;\" value=\"d\" " + " name=\"ToolbarOkCode\" lsevents=\"{'Change':[{'ClientAction':'none'},{'type':'TOOLBARINPUTFIELD'}],"+ "'Enter':[{'ClientAction':'submit','PrepareScript':'return its.XControlSubmit();','ResponseData':'delta','TransportMethod':'partial'},"+ "{'type':'TOOLBARINPUTFIELD','~XRequest':'X'}]}\" lsdata=\"{0:'',1:'',2:'',3:20,4:200,5:false,6:false,7:true,8:false,9:false,10:'STRING',11:"+ "F4LOOKUP',12:'150px',13:'LEFT',"+ "14:false,15:'',16:false,17:false,18:false,19:'AUTO',20:true,21:'NONE',22:'MM/dd/yyyy',23:false,24:'',25:'',26:false,27:false,28:'',"+ "29:'NORMAL',30:1,31:false,32:0,33:0}\"" + "ct=\"I\" autocomplete=\"off\" ti=\"0\" tabindex=\"0\" maxlength=\"200\">"; WebView webView=new WebView(this); webView.setFocusableInTouchMode(true); webView.loadData(str, "Text/html","utf-8"); setContentView(webView); 

Hope this helps you :)

0
source share

All Articles