mirror of
				https://github.com/commons-app/apps-android-commons.git
				synced 2025-10-31 06:43:56 +01:00 
			
		
		
		
	Initialize currentLatitude to null and do check
This commit is contained in:
		
							parent
							
								
									ec9d9ec4f3
								
							
						
					
					
						commit
						071ecd38cb
					
				
					 1 changed files with 3 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,7 @@ public class GPSExtractor { | |||
|             //Check what user's preference is for automatic location detection | ||||
|             boolean gpsPrefEnabled = gpsPreferenceEnabled(); | ||||
| 
 | ||||
|             if (gpsPrefEnabled) { | ||||
|             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
	
	 misaochan
						misaochan