Autofill popup not shown in Android O

428 views Asked by At

I have a sign up screen in my app which has feilds like first name, last name, zipcode and email id. We want to support autofill for this screen, when I enter these details and navigate to next screen, I am not seeing the "Save to autofill" popup asking if this details have to be saved.

This pop up is shown for some other app on the same device/emulator. I tested it on both emulator and device, but the issue persists. In the same app, autofill suggestions are shown, but when I enter a new set of data, "Save to autofill" popup is not shown.

Find below the xml

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_marginTop="50dp"
    android:orientation="vertical">

    <EditText android:id="@+id/edtFirstname"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="@dimen/fab_margin"
        android:padding="@dimen/fab_margin"
        android:importantForAutofill="yes"
        android:hint="First Name"/>

    <EditText android:id="@+id/edtLastname"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_margin="@dimen/fab_margin"
              android:padding="@dimen/fab_margin"
              android:importantForAutofill="yes"
              android:hint="Last Name"/>

    <EditText android:id="@+id/edtZipcode"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_margin="@dimen/fab_margin"
              android:padding="@dimen/fab_margin"
              android:importantForAutofill="yes"
              android:hint="Zipcode"/>

    <EditText android:id="@+id/edtEmail"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_margin="@dimen/fab_margin"
              android:padding="@dimen/fab_margin"
              android:importantForAutofill="yes"
              android:hint="Email"/>

    <Button android:id="@+id/btnSubmit"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal"
        android:text="Submit">
    </Button>
</LinearLayout>
1

There are 1 answers

0
Mina Farid On

Please check my answer Here

I posted steps to implement Autofill and fixing the issue of the popup is not showing.

It may be help somebody.