hi all i hav a lil problem.
actually i have two layouts layout-port and layout-land.
and 2 screens. both screens are in both modes of layout.
1) First Screen is Login Password Screen
2) Second Screen is ListView Screen
Now whenever i rotate my cell phone. it recreates the onCreate() method. and then change the layout as per required.
Now due to that recalling of onCreate() my list data is regenerated. How to overcome this problem. Please Tell me..
i even tried writing the following code in the menifest file
android:configChanges="orientation|keyboard|keyboardHidden"
This code works in a sense that it does not recall the onCreate() method but now the problem is that, it also does not change the layout automatically.
Mean if i m in portrait then rotate it to landscape it will not change the Layout mode.
Please guide what can i do with it.
Thanks a bunch in advance
Save some value in
onRetainNonConfigurationInstancemethodso you can check
getLastNonConfigurationInstance()is null, If null only do your list data generate codei.e in you onCreate do like this
Refer this Faster Screen Orientation Change,