6

I want to provide some autofill functionality in my app (email and password) that is written completely using Jetpack compose. I came across this blog post and this demo code which I both tried out. Unfortunately, I can't get any popup when interacting with the text fields.

After modifying my code, I ended up using the provided demo. A minimal example looks like this (the ExplicitAutofillTypesDemo composable is taken from the demo code mentioned above without any modification):

class MainActivity: AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        setContent {
            ExplicitAutofillTypesDemo()
        }
    }
}

What am I missing? Do I need to enable it somewhere else? The official compose autofill documentation is not very helpful. I only want to get a autofill popup when touching a text field like in the blog post above.

LN-12
  • 792
  • 8
  • 19

1 Answers1

7

In my case, the popup was not showing due to the fact that autofill doesn't seem to work with any other provider than Google. The debug log shows the following message:

D/Autofill Status: Autofill popup isn't shown because autofill is not available.
    
    Did you set up autofill?
    1. Go to Settings > System > Languages&input > Advanced > Autofill Service
    2. Pick a service
    
    Did you add an account?
    1. Go to Settings > System > Languages&input > Advanced
    2. Click on the settings icon next to the Autofill Service
    3. Add your account

I tried the Microsoft Authenticator as an example which does not work. When I switch to Google, everything works as intended.

stkent
  • 19,772
  • 14
  • 85
  • 111
LN-12
  • 792
  • 8
  • 19
  • I couldn't understand what does it mean here by using provider as Google ? I have a simple app in which I would like to add this option. In debug mode I tried running this but in log this got printed. Other apps that I have on my device, this feature works fine. What am I missing. I already have autofill-service account added – Ujjwal Kumar Maharana Mar 25 '23 at 16:16