Checks in onDestroy (fix #5)
Этот коммит содержится в:
@@ -124,10 +124,14 @@ public class TraccarService extends Service implements LocationListener {
|
|||||||
@Override
|
@Override
|
||||||
public void onDestroy() {
|
public void onDestroy() {
|
||||||
// Close connection
|
// Close connection
|
||||||
|
if (connection) {
|
||||||
connection.close();
|
connection.close();
|
||||||
|
}
|
||||||
|
|
||||||
// Stop location updates
|
// Stop location updates
|
||||||
|
if (locationManager) {
|
||||||
locationManager.removeUpdates(this);
|
locationManager.removeUpdates(this);
|
||||||
|
}
|
||||||
|
|
||||||
// Report status
|
// Report status
|
||||||
unregisterReceiver(updateReceiver);
|
unregisterReceiver(updateReceiver);
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user