I have an edit text that takes in phone number.
<androidx.appcompat.widget.AppCompatEditText
android:id="@+id/et_mobile_number"
style="@style/EditTextBoxNumeric"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="number"
android:maxLength="@integer/max_phone_number_length"
android:autofillHints="phoneNumberDevice"
/>
Android tries to auto fill this edit text with phone number, but while doing so fills it along with the country code. And since I have an upper limit to the number of characters this edit text can hold, the last three digits of the number are stripped down.
For example, the edit text shows auto fill option of the number (+91 77777 77890) and on clicking the option the edit text fills up with just (+91 77777 777). What I need is just (77777 77890) and not the country code (+91).
I have tried
binding.etMobileNumber.setAutofillHints(HintConstants.AUTOFILL_HINT_PHONE_NUMBER_DEVICE)
binding.etMobileNumber.setAutofillHints(HintConstants.AUTOFILL_HINT_PHONE_NATIONAL)
and
android:autofillHints="phoneNumberDevice"
android:autofillHints="phoneNational"