But what about when the user presses the home key? According to the docs, onPause() is called WHENEVER the application goes invisible, not just on the Back key, not just when another application is launched. So no, it is not just on the Back key.
On Jun 26, 9:13 am, mahesh <askmah...@gmail.com> wrote: > And you have to unregister it in your OnPause() and onStop(). > > Just as ref if you do not know this already - > OnPause() is called when you quit the application via the back button > or start another app. > OnStop() is called when it is actually killed (via task manager) > > - > maheshhttp://android.maheshdixit.com > > On Jun 25, 2:25 pm, Mark Murphy <mmur...@commonsware.com> wrote: > > > On Fri, Jun 25, 2010 at 5:21 PM, Flamechamp <flamechamp1...@yahoo.com> > > wrote: > > > This may sound stupid, but I have a problem with my application. > > > I made an application to check the accelerometer and orientation > > > sensor. > > > I tested it on my Nexus One and it works. > > > The problem starts when I close it. (I pressed the <- button in the > > > phone) When I checked the Battery usage. That program I made is still > > > there. > > > You also need to be sure to unregister your sensor listeners. If you > > do not, your program will not truly end, and you will continue > > receiving sensor data. > > > -- > > Mark Murphy (a Commons > > Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy > > > _The Busy Coder's Guide to *Advanced* Android Development_ Version 1.6 > > Available! > > -- You received this message because you are subscribed to the Google Groups "Android Beginners" group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en