mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 04:43:54 +01:00
Added null check for onLocationChanged()
This commit is contained in:
parent
8a80ea080f
commit
04d441516d
1 changed files with 3 additions and 1 deletions
|
|
@ -46,7 +46,9 @@ public class GPSExtractor {
|
||||||
|
|
||||||
locationManager.requestLocationUpdates(provider, 400, 1, myLocationListener);
|
locationManager.requestLocationUpdates(provider, 400, 1, myLocationListener);
|
||||||
Location location = locationManager.getLastKnownLocation(provider);
|
Location location = locationManager.getLastKnownLocation(provider);
|
||||||
myLocationListener.onLocationChanged(location);
|
if (location != null) {
|
||||||
|
myLocationListener.onLocationChanged(location);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void unregisterLocationManager() {
|
protected void unregisterLocationManager() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue