The docs explain why it works the way it does.

On Mon, Apr 13, 2009 at 12:49 PM, Kirk - Actual Metrics <
kirk.mora...@gmail.com> wrote:

>
> Thanks that works great. I feel kind of stupid for not figuring that
> out on my own now.  I do think it's silly for onCreate to be called
> again on rotate; there should be an onOrientationChange event or
> something.
>
> Kirk
>
> On Apr 13, 11:31 am, MrChaz <mrchazmob...@googlemail.com> wrote:
> > Take at look at on onSaveInstanceState()
> > You can use that to save things into the bundle that is passed to
> > onCreate()
> >
> > On Apr 13, 7:26 pm, Kirk <kirk.mora...@gmail.com> wrote:
> >
> > > I have an activity that responds to the accelerometer. When the device
> > > is rotated, a different layout is displayed based on whether the phone
> > > is portrait or landscape. I notice, however, that each time the phone
> > > is rotated, the onCreate method is called and all of my instance
> > > variables are reset. Is there any way to make the values of these
> > > variables persists?
> >
> > > Thanks,
> >
> > > Kirk
> >
>


-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~---------~--~----~------------~-------~--~----~
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