Disabling autosuggestion on WebView?

前端 未结 8 1023
盖世英雄少女心
盖世英雄少女心 2020-12-10 11:13

I have some HTML text inputs into a WebView, and I need to disable the autosuggetions on these inputs from Android, not from HTML (autocomplete=off).

How can I do th

8条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-10 11:37

    In Android 8 and above, you should set importance of a textview subclass for system auto-fill feature:

    android:importantForAutofill="noExcludeDescendants"
    

    Official reference: Optimize your app for autofill

    Furthermore, You might try to delete the "Web Data" sqlite file in data/data/{your-app-package}/app_webview when webview isn't in use for security's sake.

提交回复
热议问题