Activity restart on rotation Android
Posted
by Isaac Waller
on Stack Overflow
See other posts from Stack Overflow
or by Isaac Waller
Published on 2009-01-19T00:28:29Z
Indexed on
2010/03/31
3:13 UTC
Read the original article
Hit count: 529
In my Android application, when I rotate the device (slide out the keyboard) then my activity is restarted (onCreate is called). Now, this is probably how it's supposed to be, but I do a lot of initial setting up in the onCreate method, so I need either:
1. Put all the initial setting up in another function so it's not all lost on device rotation or
2. Make it so onCreate is not called again and the layout just adjusts or
3. Limit the app to just portrait so that onCreate is not called.
© Stack Overflow or respective owner