我正在尝试在 Web 视图中打开一个网页,它在 andoid 4.1.2 及更低版本上运行良好,但是当我在 android 4.2.2 即 nexus 4 中尝试相同的代码时,它没有从键盘输入任何输入。
当我单击网页上的任何编辑文本时,键盘会打开并且它还显示编辑文本的焦点,但是一旦我按下任何字符键盘焦点就会从编辑文本中丢失,并且在该字段上没有输入任何内容。低是我的代码
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.getSettings().setPluginState(PluginState.ON);
mWebView.getSettings().setAllowFileAccess(true);
mWebView.setWebViewClient(new MyWebViewClient());
mWebView.clearHistory();
mWebView.clearFormData();
mWebView.clearCache(true);
mWebView.loadUrl(strUrl);
mWebView.requestFocus();
/**
* webview client
*/
private class MyWebViewClient extends WebViewClient {
@Override
// show the web page in webview but not in web browser
public boolean shouldOverrideUrlLoading(WebView view, String url) {
if ( !getSuceessParams(url) )
view.loadUrl(url);
return true;
}
@Override
public void onReceivedHttpAuthRequest(WebView view, HttpAuthHandler handler, String host, String realm) {
handler.proceed("checkin", "4good");
}
@Override
public void onPageFinished(WebView view, String url) {
System.out.println("onPageFinished " + url);
context.removeDialog(0);
super.onPageFinished(view, url);
}
@Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
System.out.println("onPageStarted " + url);
Fragment fragment = context.getLastFragment();
if ( fragment.getTag() == "campaign_donation_web_fragment" ) {
CheckinLibraryActivity.strProgressMessage = "Loading..";
context.showDialog(0);
}
super.onPageStarted(view, url, favicon);
}
}
我收到以下错误
****Should not happen: no rect-based-test nodes found
谢谢