mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
Merge pull request #280 from misaochan/fix-location-0
Fix (0,0) location bug
This commit is contained in:
commit
93e8b777bb
1 changed files with 4 additions and 2 deletions
|
|
@ -25,7 +25,8 @@ public class GPSExtractor {
|
|||
|
||||
private String filePath;
|
||||
private double decLatitude, decLongitude;
|
||||
private double currentLatitude, currentLongitude;
|
||||
private Double currentLatitude = null;
|
||||
private Double currentLongitude = null;
|
||||
private Context context;
|
||||
public boolean imageCoordsExists;
|
||||
private MyLocationListener myLocationListener;
|
||||
|
|
@ -113,7 +114,8 @@ public class GPSExtractor {
|
|||
//Check what user's preference is for automatic location detection
|
||||
boolean gpsPrefEnabled = gpsPreferenceEnabled();
|
||||
|
||||
if (gpsPrefEnabled) {
|
||||
//Check that currentLatitude and currentLongitude have been explicitly set by MyLocationListener and do not default to (0.0,0.0)
|
||||
if (gpsPrefEnabled && currentLatitude != null && currentLongitude != null) {
|
||||
Log.d(TAG, "Current location values: Lat = " + currentLatitude + " Long = " + currentLongitude);
|
||||
return String.valueOf(currentLatitude) + "|" + String.valueOf(currentLongitude);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue