Android scrolls to the focused EditText inside a ScrollView when the activity gains focus.
How can I tell Android NOT to do this but instead maintain scroll position?
The situation:
A validation method must scroll to a TextView for the user's attention. It sets focus to an EditText outside the viewable area to avoid user confusion (which happens when Android sets focus on the closest but unrelated EditText after scrolling down).
The user clicks a button and enters data in a second activity via startActivityForResult. onActivityResult renders the result in the same TextView. Now the TextView is no longer visible because Android scrolls to the focused EditText.
Try setSelected(false)
for the EditText.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With