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

My point still stands... You can't control the Activity Lifecycle.  I think
it is strange as well.  But that doesn't mean I have any control over it.
 If you feel it is a bug then feel free to report it.

*> 1. Running the app then bringing it to the background by pressing home
and then pushing the lock button does not destroy my activity.*
*
*
Right, because it is no longer in the foreground.  You home app is.  I would
be willing to bet that the same thing that happens to your app when it is in
the foreground is happening to the home app (or any other app that happens
to be in the foreground at the time the screen lock button is pushed.  I
haven't checked to see if this happens with my apps, but now I'm curious and
will look into it.  Unless you are doing something strange with your app
(like maybe calling finish() in onPause() or something like that), the
behavior should be the save across the board for all apps...

*> 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.*
*
*
That's interesting... on my phone when I press the screen lock button with
Angry Birds running and unlock my phone Angry Birds is no longer running.

*> The music is not running in a service.*
*
*
You don't know that.

Thanks,
Justin Anderson
MagouyaWare Developer
http://sites.google.com/site/magouyaware


On Fri, May 13, 2011 at 3:19 AM, Jump <[email protected]> wrote:

> 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

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