androidautofillandroid-autofill-manager

Auto submit autofill entry on android app


In my Android app, I would like to automatically submit (i.e., click on the login button) when the user taps on the saved credentials (e-mail + passoword) that appear on top of the Google keyboard. Is there a callback or any other way to achieve this? Thank you


Solution

  • You can try to attach TextWatcher to both fields and add logic to trigger login action when certain conditions are met.

    But I'd rather say "don't do that", as you cannot really tell if what is entered is what user would like to send. Maybe keyboard suggestion was good enough to be accepted but user wants to edit i.e. login for some reasons prior sending? Or he just wanted to use it but not send. You cannot tell. The auto submit is not what user expects to happen and doing so you'd annoy rather annoy than help. That's simply bad U/X in my oppinion, so again, I recommend to rethink the approach.