If I have a layout with lots of EditText views in a LinearLayout and
the user focuses the third one down and flips out the keyboard to
start typing, the entire layout is destroyed and recreated through the
activity lifecycle.  When everything is done, however, the third
EditText is given focus again and the user never knows that anything
happened and types away.

I am creating a similar layout, but due to the nature of my data, I
have to dynamically create the list of EditTexts, mixed with some
other views. The default layout has one EditText at the top, a
ScrollView with a LinearLayout child (which will be filled with
EditTexts later), and some action buttons at the bottom.  Then I fill
the LinearLayout with all the EditText fields I need (based on extras
passed via intent).

This part works quite well, but the way the activty handles Runtime
Configuration changes is broken now (from a UI perspective).  Now if
the user focuses the third EditText (which was dynamically created via
new EditText()) and flips out the keyboard, the layout is destroyed
and recreated, but focus is always given to the permanent EditText at
the top of the screen.

Is there something I need to do when adding my dynamic views to make
sure they can keep focus through orientation changes?  Or is there a
way I can work around the issue and force focus to be given to the
last view that had it before the change?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to