If you are not changing the layout of the list items then you can just say that your activity handles the orientation change and then your activity will still be there when orientation changes - it will not be killed. Checkout the android:configChanges property for your activity. If you do have a different row layouts for landscape and portrait mode in ur list view then you will have to re-draw it again. If you are using an adapter to drive your list view then just call setListAdapter() again. You can make the adapter driving the list view staic for the activity so that it maintains its state even if you change your orientation and your activity is killed. However make sure that you null out the adapter when the activity is destroyed else you will get unexpected results!!
- SD On May 13, 1:29 pm, Alok Kulkarni <[email protected]> wrote: > I am having an application showing ListItems and Dialog boxes in it.. > I want that when i change the orientation from Portrait to landscape mode, i > need to maintain the state of the application .. I have seperate XMLs for > landscape and portrait mode.. > What is the best way to achieve this > > Thanks , > Alok. > > -- > 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 > athttp://groups.google.com/group/android-developers?hl=en -- 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

