How to stop Activity restart on rotation of Android Device?

+3 Amit . · January 8, 2015
On this http://stackoverflow.com/questions/456211/activity-restart-on-rotation-android?lq=1 question solutions are available but in comments people are claiming answers to be not working or depreciated with newer versions.

What is the correct way to solve this problem?

Post a Reply

Replies

Oldest  Newest  Rating
+1 Amit . · January 8, 2015
Hector Boone that video is only useful for onPause and onResume but in case of screen rotation onCreate() is also called and it resets everything.
+1 Hector Boone · January 9, 2015
Amit

This should explain everything for you

http://www.i-programmer.info/programming/android/5966-android-adventures-lifecycle-and-state.html

If you register with the site you can download the source code

Good luck
0 Troy Jones · January 8, 2015
I usually just lock mine to portrait in the manifest, but there is another way to do both.  I remember watching it in thenewbostons eclipse android series.
0 Hector Boone · January 8, 2015
Bucky has a great tutorial explaining the activity life cycle

https://www.youtube.com/watch?v=-G91Hp3t6sg
  • 1

Java / Android Development

107,013 followers
About

Very popular language used to create desktop applications, website applets, and Android apps.

Links
Moderators
Bucky Roberts Administrator