From 4d653825d66d96a6ec7c06f87c554922055ccff6 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Sun, 11 Nov 2012 20:55:59 +0100 Subject: [PATCH] Fix application close (suggest to kill background service on close) --- OsmAnd/src/net/osmand/plus/OsmandApplication.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/OsmAnd/src/net/osmand/plus/OsmandApplication.java b/OsmAnd/src/net/osmand/plus/OsmandApplication.java index 2a6e45a193..697d0d6268 100644 --- a/OsmAnd/src/net/osmand/plus/OsmandApplication.java +++ b/OsmAnd/src/net/osmand/plus/OsmandApplication.java @@ -381,6 +381,10 @@ public class OsmandApplication extends Application { manager.close(); } applicationInitializing = false; + if(getNavigationService() != null) { + final Intent serviceIntent = new Intent(this, NavigationService.class); + stopService(serviceIntent); + } // http://stackoverflow.com/questions/2092951/how-to-close-android-application System.runFinalizersOnExit(true); System.exit(0);