onStop is not called until the other activity has been displayed and is idle. If it is taking a long time to show, run the profiler on your code to see what you are doing that is so slow.
On Tue, Aug 23, 2011 at 11:42 AM, Amit <[email protected]> wrote: > Hi, > > I am stuck here. I have an activity (say Activity 1) with a button. On > click of the button I am starting a new activity (say Activity 2 )and > then calling finish(). But what I see is, before starting Activity2, > Activity1 remains in the focus for a while (5-7 secs approximately) > and then it desappears and Activity 2 comes up. Why is this delay ? > > From log, i see onPause() is called immediately after the button click > but there is significant delay in the call onStop. > Also, this delay is seen only when app is launched from the home > screen and it works fine if launched from the main menu. > > Code snippet: Activity1 > > public void onClick(View v) { > // do some stuff > startActivity(intent); // start Activity2 > finish(); > } > > Note: Activity1 and Activity2 are in the different packages and > singleTask. > > Any help is really appreciated. > > -- > 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 > -- Dianne Hackborn Android framework engineer [email protected] 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 [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

