Added temporary fix to ACCESS_FINE_LOCATION permission error

This commit is contained in:
Adam Ding 2020-12-03 14:54:57 -05:00
parent 3b1b787a7a
commit 65e0b30eb2

View File

@ -94,7 +94,17 @@ public class MainActivity extends AppCompatActivity implements CreateListDialogF
0
);
}
Location location = lm.getLastKnownLocation(LocationManager.GPS_PROVIDER);
Location location;
while(true) {
try {
location = lm.getLastKnownLocation(LocationManager.GPS_PROVIDER);
break;
} catch(java.lang.SecurityException e) {
//User clicked delete
}
}
if(location != null) {
double longitude = location.getLongitude();
double latitude = location.getLatitude();