I want to switch OpenGL on and off in my activity, because there are
moments that would really benefit from the acceleration, even if that
means re-starting the activity (my app goes through the cycle pretty
fast). But there are also moments where I can't use OpenGL because it
does not support all the canvas functions. I use:

requestWindowFeature(Window.FEATURE_OPENGL);

But this can only be called in onCreate, so to test it I currently
just flip the screen which restarts the activity.

I can do without, but it would be nice if there was a restart()
function. The functionality is already there with the configuration
change.


On Aug 27, 9:06 pm, "Justin (Google Employee)" <[EMAIL PROTECTED]>
wrote:
> You could have Activity A start Activity B and after starting B
> calling finish(). Then have B, perhaps as the result of a button
> press, start a new instance of A. Of course, finish() won't result in
> onSaveInstanceState being called, which I believe is when a
> configuration change (because naturally after the screen rotates you
> want the user to see the same web page or whatever as they say before
> the screen rotation). You can cause the emulator to change orientation
> and do the same thing, see the emulator docs for more information on
> this.
>
> What are you trying to accomplish though?
>
> Cheers,
> Justin
> Android Team @ Google
>
> On Aug 27, 11:52 am, webmonkey <[EMAIL PROTECTED]> wrote:
>
>
>
> > A configuration change as described in:
>
> >http://code.google.com/android/reference/android/app/Activity.html#Co...
>
> > "Unless you specify otherwise, a configuration change (such as a
> > change in screen orientation, language, input devices, etc) will cause
> > your current activity to be destroyed, going through the normal
> > activity lifecycle process of onPause(), onStop(), and onDestroy() as
> > appropriate. If the activity had been in the foreground or visible to
> > the user, once onDestroy() is called in that instance then a new
> > instance of the activity will be created, with whatever
> > savedInstanceState the previous instance had generated from
> > onSaveInstanceState(Bundle)."
>
> > I actually don't care about configuration changes but I would like to
> > be able to restart my activity from the activity itself and that it
> > will go through the same lifecycle as described above.
>
> > On Aug 27, 8:40 pm, "Mark Murphy" <[EMAIL PROTECTED]> wrote:
>
> > > > Is there a way for an Activity to restart itself, so that you go
> > > > trough a similar cycle that you get when there is a configuration
> > > > change?
>
> > > Ummmm...not sure what you mean by "configuration change", but if your
> > > activity calls finish(), it will close up and exit the activity. At least
> > > in M5, it will call all appropriate lifecycle methods on its way out the
> > > door -- I'll be testing that under 0.9 this weekend.
>
> > > --
> > > Mark Murphy (a Commons Guy)http://commonsware.com
> > > _The Busy Coder's Guide to Android Development_ Version 1.1 Published!- 
> > > Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to