Disabling Android O auto-fill service for an application

后端 未结 10 1768
死守一世寂寞
死守一世寂寞 2020-11-27 05:13

Android O has the feature to support Auto-filling for fields. Is there any way I can disable it for a specific application. That is I want to force my application not to use

10条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-27 05:48

    I believe the accepted answer is incorrect:

    So I have my own class which is extends the android.support.v7.widget.AppCompatEditText and all I did is overwrote the following method with the following value:

    @Override
    public int getAutofillType() {
        return AUTOFILL_TYPE_NONE;
    }
    

    no other solutions worked, not even android:importantForAutofill="no".

    getAutofillType() comes from the View class, so it should work for every other class such as TextInputEditText too!

提交回复
热议问题