I ran into problems when trying to use Autofill Framework for the login fragment, it does not show the save popup. I placed android:autofillHints
attribute on both text fields, then I tried android:importantForAutofill="yes"
on both with the same results, and I also tried to call AutofillManager.requestAutofill()
and AutofillManager.commit()
manually.
Next I downloaded an example from here and installed it, and it worked normally. I used debug to check AutofillManager in both apps and it turned out that AutofillManager.isEnabled()
produces different results: true in a sample app and false in my app. In both cases I checked the first line of onCreate()
in a first activity of an app, which in both cases does not contain fields to be filled.
That's why I think a problem is not in the code or layout files, but rather in the gradle or manifest files, but I could not find any difference in those that could have affected the Autofill Framework. I do not think that framework also has configuration values. I checked targetSdk and minSdk, but that's not it
What else should I check?
AutofillManager.isEnabled()
should not produce different results on your app or the sample app, my guess is that you're using the wrong context to get the manager, it should be theActivity
.