I am integrating google smart lock in my android application but in some devices i am getting this error when trying to save credentials to google. I am using following code to save credentials -
Credential credential = new Credential.Builder(email)
.setPassword(password)
.build();
saveCredentials(credential);
After search on google for this solution found that need to disable auto-fill feature in application to save the password.
Try 1 - Put the following code in activity for commit autofillmager in specific activity and disable autofill. But it is not working.
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
AutofillManager autofillManager = getSystemService(AutofillManager.class);
autofillManager.commit();
getWindow()
.getDecorView()
.setImportantForAutofill(View.IMPORTANT_FOR_AUTOFILL_NO_EXCLUDE_DESCENDANTS);
}
Try 2 - Put following in properties in EditText
android:longClickable="false"
longClickable should stop autofill but it is not working.
android:importantForAutofill="no"
Also try with importantForAutoFill
but it is also not working.