In my app, I have an Activity, which contains a Fragment, which contains a ListView with various EditTexts, like so:
Activity -> Fragment -> ListView -> EditTexts
When an EditText is tapped, the soft keyboard is displayed and one of two things happens:
If the Activity has not yet lost focus (via visiting the Android home screen, for example), the entire activity slides up slightly so that the EditText is not obscured by the keyboard.
If the Activity has lost focus at some point (again, such as visiting the Android home screen), the ListView scrolls the EditText above the keyboard (the activity remains stationary), BUT the EditText loses focus!
Neither of these results is ideal. Ideally, I always want the ListView to scroll the EditText above the keyboard without the EditText losing focus. Can anybody point me in the right direction and/or explain why I am seeing two different behaviors for the same action right now?
Edit: For reference, I'm building for Android 4.2 and testing on Nexus 7 tablet.