Webview中的文本输入错误

时间:2019-03-09 17:54:25

标签: java android textview android-webview inputview

对不起,我的英语。 该应用程序将网站上的页面加载到WebView中,您需要在网站上按行输入数据。输入文字时,我看不到输入的内容,只有再次触摸传感器后,才会显示输入的文字。可能是什么问题呢?我想看看我在实时文本字段中输入的内容。
这是代码审查:

`@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.browser);

final TextView txtview = (TextView)findViewById(R.id.tV1);
final ProgressBar pbar = (ProgressBar) findViewById(R.id.pB1);
mWebview  = (WebView) findViewById(webView);
WebSettings webSettings = mWebview.getSettings();
webSettings.setJavaScriptEnabled(true);
WebView mWebview = findViewById(R.id.webView);
mWebview.getSettings().getJavaScriptEnabled();
webSettings.setUseWideViewPort(true);
webSettings.setLoadWithOverviewMode(true);
webSettings.setAllowFileAccess(true);
webSettings.setJavaScriptCanOpenWindowsAutomatically(true);
  webSettings.setBuiltInZoomControls(true);
 webSettings.setSupportZoom(true);
webSettings.setAllowContentAccess(true);
final Activity activity = this;
mWebview.setWebViewClient(new WebViewClient() {
    public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
        Toast.makeText(activity, description, Toast.LENGTH_SHORT).show();
    }
});
mWebview .loadUrl("http://.............../");`

0 个答案:

没有答案