3

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

enter image description here

aminography
  • 21,986
  • 13
  • 70
  • 74

3 Answers3

9

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);
        }
    }
Umesh Sonawane
  • 517
  • 6
  • 17
5

If none of the suggestions worked, like with me, try this as a last resort:

android:importantForAutofill="no"
JJ Du Plessis
  • 1,047
  • 12
  • 9
-1

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