I am familiar with the activity lifecycle. To make myself clear. I am 
finding the behavior strange in this case.

1. Running the app then bringing it to the background by pressing home and 
then pushing the lock button does not destroy my activity.
2. Running the app then pushing the lock button destroys my activity and 
then instantly creates it again. 

Doing (1) i can get the app to run in the background while device is locked 
without it being destroyed, but doing (2) I cannot. Seems strange to destroy 
the activity and then instantly create it again.

Doing (2) with Angry Birds does not destroy the activity, it leaves it as it 
is. Because when you go back to the game it runs instantly, no texture 
loading or anything. The music is not running in a service. And the music 
does stop when going to the background via the home button (1), so that's 
why I was thinking it had something to do with that.


Anyway, thank you for any hints.







Den fredagen den 13:e maj 2011 kl. 01:01:48 UTC+2 skrev MagouyaWare:
>
> *> When I run my game app and then push the sleep/lock-screen button my 
> activity is destroyed (onDestroy is called) and then directly after, 
> onCreate is called.*
> *
> *
> Welcome to the Android Activity Lifecycle... You have no control over it...
> *
> *
> *> Angry Birds actually keeps the music running when the lock screen is 
> on, maybe there's some trick with that you can use?*
>
> Obviously I don't know for sure, but Angry Birds is probably playing its 
> music in a Service...  Which is different than keeping the app alive.
>
> *> I do not want to handle state.*
> *
> *
> Good luck... That is how Android handles this.
> ***
> * Thanks,
> Justin Anderson
> MagouyaWare Developer
> http://sites.google.com/site/magouyaware
>
>
> On Tue, May 10, 2011 at 8:00 AM, Jump <[email protected]> wrote:
>
>> I do not want to handle state
>
>
>

-- 
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]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to