On Sat, Aug 28, 2010 at 3:50 AM, Yaniv Gal <[email protected]> wrote: > When I wanted to close the application I clicked on the home screen, > but the app is still playing in the background.
Correct. Users do not close applications in Android. > Than I tried to click on the "back" key, but nothing happend You have a bug in your activity, then. Try starting with a plain "hello, world" activity, and work your way up from there. > so I've > created a key event listener for the 'back" key, and inside that > method I wrote finish(); That is unnecessary and may be contributing to your confusion. The default handler for the BACK button calls finish(). > Now my app is closing but I think it's still running in the > background, because when I go to "manage applications" I can still see > it in the "running" tab, and if I press it, I see I can click on the > "force close" to actually close the app. That tab does not mean what you think it means. The fact that your application appears there probably merely means there is a process still in memory that most recently was running your code. It does not mean that any of your components (activities, etc.) are still considered to be "live". Android will recycle that process in time. > What do I need to do in order to really close the app without leaving > it open (one way or another)? Unregister any system listeners you have (e.g., location, sensors). Stop any threads you forked manually. Stop any services you started with startService(). Beyond that, Android will take care of matters itself. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _The Busy Coder's Guide to *Advanced* Android Development_ Version 1.9 Available! -- 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

