You put it in the wrong place. Your Activity's onDestroy() won't be called until after your activity is already stopped, so putting a call to finish() in there is kinda pointless.
On Mon, Feb 16, 2009 at 4:33 AM, <[email protected]> wrote: > > I have added the below code in my Activity to stop the Activity, but it > doesn't stop my Activity. > > *protected* *void* onDestroy() { > finish(); > // *TODO* Auto-generated method stub > *super*.onDestroy(); } > > My objective is to stop/kill the current Activity, so that it will go back > to my previous Activity. > > Thanks & Regards, > Sunil > > > > > *for android <[email protected]>* > Sent by: [email protected] > > 02/16/2009 04:25 PM > Please respond to > [email protected] > > To > [email protected] cc > Subject > [android-developers] Re: How to stop an Activity > > > > > calling finish will close an activity. > > A service should not ideally start an activity,it should throw up a > notification. > > On Mon, Feb 16, 2009 at 4:19 PM, Android > <*[email protected]*<[email protected]>> > wrote: > > Hi, > > I have one Activity, that starts one Service and my service will lunch > one Activity, i wanna to stop the Activity which one started my my > Service after few seconds. > Is there any way to achieve. Has anyone experienced this type of > scenario. > > -Sunil > > > > > > ______________________________________________________________________ > > ______________________________________________________________________ > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

