Thanks! I finally get it.
For those who are referring to this thread, I unregistered location
listener under the main Activity:
@Override
public void onDestroy(){
super.onDestroy();
//unregister location listener
locationManager.removeUpdates(locationListener);
}
>
> It does stop retrieving GPS signals after I exit the app.
If this is why you're doing this, you're going about this the wrong way. Use
finish() on your activity, not System.exit(), and if you have a location
listener set up that is using the GPS make sure to unregister it in your
onPause() /
Any particular reason you are using System.exit() as opposed to finish()???
finish() gives Android the opportunity to do any cleanup that it needs to
when your app gets done... I would imaging that System.exit() bypasses this.
--
Thanks Justin and TreKing!
I haven't found the error for onDestroy after looking at the log
but I've managed to close the application using JAVA System.exit()
instead.
It does stop retrieving GPS signals after I exit the app.
On Jan 7, 2:20 am, TreKing wrote:
> > BTW, if i change onDestroy(
4 matches
Mail list logo