mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-06-05 21:49:48 +02:00
Fix crash when acquiring location
This commit is contained in:
@@ -543,12 +543,11 @@ public class SettingsActivity extends AbstractSettingsActivityV2 {
|
|||||||
String longitude = String.format(Locale.US, "%.6g", location.getLongitude());
|
String longitude = String.format(Locale.US, "%.6g", location.getLongitude());
|
||||||
LOG.info("got location. Lat: " + latitude + " Lng: " + longitude);
|
LOG.info("got location. Lat: " + latitude + " Lng: " + longitude);
|
||||||
GB.toast(requireContext(), getString(R.string.toast_aqurired_networklocation), 2000, 0);
|
GB.toast(requireContext(), getString(R.string.toast_aqurired_networklocation), 2000, 0);
|
||||||
EditTextPreference pref_latitude = findPreference("location_latitude");
|
GBApplication.getPrefs().getPreferences()
|
||||||
EditTextPreference pref_longitude = findPreference("location_longitude");
|
.edit()
|
||||||
pref_latitude.setText(latitude);
|
.putString("location_latitude", latitude)
|
||||||
pref_longitude.setText(longitude);
|
.putString("location_longitude", longitude)
|
||||||
pref_latitude.setSummary(latitude);
|
.apply();
|
||||||
pref_longitude.setSummary(longitude);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user