Closed GoogleCodeExporter closed 9 years ago
Thanks for the report.
See r68 for details, but it seems the only 'right' way to do this is save state
in
the global application object and recreate onResume(). I am saving the progress
dialog message and the handler onPause(), and passing the new Activity to the
handler
onResume().
Still needs some testing though.
Original comment by nikolay....@gmail.com
on 25 May 2010 at 9:35
I just discovered an even easier solution. Just modify the activity's
declaration in
your manifext xml to say:
android:configChanges="orientation|keyboardHidden|keyboard"
This will make it so that the Activity doesn't destroy and recreate itself
every time
you change the screen orientation or pop out the keyboard. Instead of
onPause(),
onResume(), and onCreate() getting called, you get onConfigurationChange()
called. I
have no idea why this isn't the default in Android, because this is much
easier. I'm
using this for all my activities now (except for activities whose style is
Theme.Dialog, because it seems to prevent the activity from properly resizing
its
window width).
Original comment by nolan.la...@gmail.com
on 25 May 2010 at 3:20
Yes, I checked that out too. But then the screen doesn't rotate, and to make it
consistent I'll have to use it for every activity and I'd like to avoid that.
Original comment by nikolay....@gmail.com
on 25 May 2010 at 3:45
Are you sure the screen doesn't rotate? I'm using it for the newest version of
Pokédroid, and the screen rotates for me when I turn the phone...
Original comment by nolan.la...@gmail.com
on 26 May 2010 at 4:02
Hm, it does rotate. Maybe I overrode onConfigurationChange() without calling
through
to super. Might use it after all.
Original comment by nikolay....@gmail.com
on 26 May 2010 at 4:27
fixed
Original comment by nikolay....@gmail.com
on 28 May 2010 at 2:25
Original issue reported on code.google.com by
nolan.la...@gmail.com
on 18 May 2010 at 7:18