In my tests, it looks like onSavedInstanceState() does not get called
when switching from portrait to landscape mode, or vice versa.

It does get called if you press the Home button.

This is on an Android 2.1 device, but it most likely applies to 1.6
and afterwards as well.

Does anyone know an easy way to test the onSavedInstanceState()
functionality ?  I tried using a task manager to kill my app, but
unfortunately it doesn't call the onSavedInstanceState() function.

Gino.


On Apr 2, 12:46 pm, Mark Murphy <mmur...@commonsware.com> wrote:
> On Sat, Apr 2, 2011 at 12:28 PM, b_t <bartata...@gmail.com> wrote:
> > And is there any way to force stop activity A to test if
> > my onRestoreInstanceState and onSavedInstanceState implementation
> > works
> > when returning from B?
>
> Sure. Rotate the screen. By default, that will destroy and recreate
> the activity.
>
> > In my device A is never destroyed.
>
> That seems unlikely.
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>
> Android Training...At Your Office:http://commonsware.com/training

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to