Friday, February 24, 2012

[android-developers] Re: onStop() coming with delay

Hi Pavel
in activity life cycle when u will move one activity to another-->
when foreground activity will lose focus the onPause and then new
activity will be foreground and that activity will be all onStop()
method and then android system will check whether that activity is
last activity or not or needs ti kill that activity .. then on destroy
function will get call.


In your case two thing may happen
1. 2nd activity is taking time to come in foreground
2. r u dong any operation in onstop method?


Moktarul anam


On Feb 23, 7:03 am, Pavel Dudka <dudka.pa...@gmail.com> wrote:
> I have a problem in one of my apps.
>
> I have 2 activities (2 different apps) - 1st is in foreground, and 2nd
> is in background.
>
> When I press back button - it finishes 1st activity and puts 2nd to
> the foreground. For the first activity onPause()->onStop()->onDestroy
> is called.
> It looks correct, but onStop->onDestroy is coming with delay (~2sec)
> which is not what I expect.
> I can live with onDestroy() delay, but I did not expect that call to
> onStop() can be delayed as well.
>
> As I understand onStop() should be called right after activity has
> disappeared from the screen, but I'm curious why there is such delay.
>
> What could possibly cause that kind of things?

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

No comments:

Post a Comment