Currently, the issue is clicking on autosuggested text only filling the first textinput box, I want to fill all the six text inputs with the suggested code
Autosuggested Keyboard screen shot:
On clicking the autosuggested text, it is only filling first
Expected behaviour is to fill all the textinputs once user clicks on autosuggested code
This is a less explored use-case on StackOverflow, but, when you read Android docs for Auto-fill, in the OTP section, they have already provided generateSmsOtpHintForCharacterPosition
which states and I quote:
When using multiple views where each view maps to a single digit of the OTP, you can use the generateSmsOptHintForCharacterPosition() method to generate per-character hints.
You can utilize the characterPosition
parameter to auto-fill each EditText
with the respective digit of the OTP auto-filled.
To do that, set
//Where Character Position (int) represents the digit position of the OTP for respective EditText, ranges from 1 to 8.
android:autofillHint="smsOTPCode{characterPosition}"
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.