Handle missing provider (fix #127)
Этот коммит содержится в:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2013 - 2014 Anton Tananaev (anton.tananaev@gmail.com)
|
* Copyright 2013 - 2015 Anton Tananaev (anton.tananaev@gmail.com)
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -67,15 +67,15 @@ public class PositionProvider {
|
|||||||
if (useFine) {
|
if (useFine) {
|
||||||
try {
|
try {
|
||||||
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, period, 0, fineLocationListener);
|
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, period, 0, fineLocationListener);
|
||||||
} catch (Exception ex) {
|
} catch (Exception e) {
|
||||||
|
StatusActivity.addMessage(context.getString(R.string.status_provider_missing));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (useCoarse) {
|
if (useCoarse) {
|
||||||
try {
|
try {
|
||||||
locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, period, 0, coarseLocationListener);
|
locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, period, 0, coarseLocationListener);
|
||||||
} catch (Exception ex) {
|
} catch (Exception e) {
|
||||||
|
StatusActivity.addMessage(context.getString(R.string.status_provider_missing));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
handler.postDelayed(updateTask, period);
|
handler.postDelayed(updateTask, period);
|
||||||
|
|||||||
@@ -43,5 +43,6 @@
|
|||||||
<string name="status_location_update">Location update</string>
|
<string name="status_location_update">Location update</string>
|
||||||
<string name="status_preference_update">Preference update</string>
|
<string name="status_preference_update">Preference update</string>
|
||||||
<string name="status_connectivity_change">Connectivity change</string>
|
<string name="status_connectivity_change">Connectivity change</string>
|
||||||
|
<string name="status_provider_missing">Missing location provider</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user