On Sun, Oct 17, 2010 at 8:09 PM, rsnider19 <[email protected]> wrote:
> I notice that my application continues to run in the background after I hit > the home or back button. > Hitting Home will only pause then stop your application, not finish it (unless it's hidden long enough). Regardless, Android will keep your process alive as long as it wants in case the user comes back to it, so it doesn't have to recreate everything from scratch. > I tried calling the finish() method and it still says its running. > finish() ends your current Activity, it doesn't terminate the process it's running in. > On another note, how do I setup the keyListener to respond to the user > hitting the back or home button. > You can handle the back key but not the Home key. There's a new onBackKeyPressed function (I think, look for it) you can use for this. > I tried implementing OnKeyListener and using > findViewById(R.Layout.main).setOnKeyListener(this) to call finish(). > Calling finish() on the back key press is the default behavior so there's zero reason to do this. ------------------------------------------------------------------------------------------------- TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago transit tracking app for Android-powered devices -- 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

