如何在Android WebView中禁用输入自动提示

时间:2019-04-17 09:33:12

标签: java android kotlin android-webview webviewclient

我有一个显示某些输入的Web视图,并且运行良好,除非单击输入a,否则会弹出Google信用卡自动提示,我必须删除此选项并且找不到解决方法,

provided image with the unwanted result

我尝试了此帖子-Disabling autosuggestion on WebView?    但是建议的答案都没有帮助我,请帮助

我的webView

    if (webView == null) {
        toolbar_container.show()
        toolbar_group.show()
        toolbar_tv.text = getString(R.string.credit_card_info)
        webView = NoSuggestionsWebView(this)
        val webSettings = webView?.settings
        WebViewDatabase.getInstance(this)?.clearFormData()
        webSettings?.javaScriptEnabled = true
        webSettings?.savePassword = false
        webSettings?.saveFormData= false
        webView?.setBackgroundColor(Color.parseColor("#061a3e"))
        webView?.addJavascriptInterface(WebAppInterface(this) { result ->
            val dialog =
                OneButtonDialog(
                    activity = this@MainActivity,
                    type = OneButtonDialog.LOAD_CARD_FAILED,
                    message = result
                )
            dialog.show()
        }, "Android")
        webView?.layoutParams?.height = WindowManager.LayoutParams.MATCH_PARENT
        webView?.layoutParams?.width = WindowManager.LayoutParams.MATCH_PARENT
        fragment_container.addView(webView)
        webView?.loadUrl("My_URL")
        showProgressBar()
    }
    webView?.webViewClient = object : WebViewClient() {

        override fun onPageFinished(view: WebView?, url: String?) {
            super.onPageFinished(view, url)
            dismissProgressBar()
        }
    }

0 个答案:

没有答案