问题
How can I prevent this from happening, multiple users are going to use the app on the same device and I do not want all of them having access to some places
回答1:
You simply just add one property to your editText view
android:inputType="textPassword|textNoSuggestions"
and you are done.
if it is not working for you there is another alternative solution. You can turn off autofill programmatically.
You can try to this.
public class BaseActivity extends AppCompatActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
disableAutoFill();
}
@TargetApi(Build.VERSION_CODES.O)
private void disableAutoFill() {
getWindow().getDecorView().setImportantForAutofill(View.IMPORTANT_FOR_AUTOFILL_NO_EXCLUDE_DESCENDANTS);
}
}
回答2:
This worked for me https://www.addictivetips.com/android/google-autofill-settings-for-apps-android/
Disabling the autofill from Google, but I did not find how to do it just for my app
来源:https://stackoverflow.com/questions/52961540/prevent-android-from-saving-and-retrieving-passwords-when-typing-on-edittext