I have configured my app to support Android Oreo with compileSdkVersion 26
. I've also set up android:autofillHints="phone"
for my phone number input field. When I tap on the field, I can see "Autofill" popping up. However, when I tap on "Autofill", "Contents can't be autofilled" toast appears and I see the following trace in logcat:
RemoteFillService Not handling { when=-3ms what=3 target=com.android.internal.os.HandlerCaller$MyHandler } as service for ComponentInfo{com.google.android.gms/com.google.android.gms.autofill.service.AutofillService} is already destroyed
View dispatchProvideAutofillStructure(): not laid out, ignoring
How should I fix this? I've confirmed that I have the phone number configured in Settings > System > Languages & input > Advanced > Input assistance > Autofill service.
UPDATE with a sample XML: In API 26 emulator settings, I can select "Autofill with Google". Using the Design tab of Android Studio, I added a "Phone" type EditText
, and then manually inserted android:autofillHints="phone"
in the XML element:
<EditText
android:id="@+id/editText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="phone"
android:autofillHints="phone" />
Logcat peculiarities described above can be observed using this XML.
android:autofillHints="phone"
. I'll try to find some time to elaborate. However, Autofill with Google seems to be a bit immature feature in its current status: plus.google.com/+JuusoOhtonen/posts/4kzMk5LUGLW – Glabrousautofill
works perfectly (without additional code changes)! – Glabrous