Add catch for SecurityException

This commit is contained in:
misaochan 2016-07-15 17:13:39 +12:00
parent e27b417a9a
commit 7592b0bae1

View file

@ -63,13 +63,19 @@ public class GPSExtractor {
if (location != null) { if (location != null) {
myLocationListener.onLocationChanged(location); myLocationListener.onLocationChanged(location);
} }
} catch (IllegalArgumentException e){ } catch (IllegalArgumentException e) {
Log.e(TAG, "Illegal argument exception", e); Log.e(TAG, "Illegal argument exception", e);
} catch (SecurityException e) {
Log.e(TAG, "Security exception", e);
} }
} }
protected void unregisterLocationManager() { protected void unregisterLocationManager() {
try {
locationManager.removeUpdates(myLocationListener); locationManager.removeUpdates(myLocationListener);
} catch (SecurityException e) {
Log.e(TAG, "Security exception", e);
}
} }
/** /**