mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-11-29 05:16:51 +01:00
Fix crash when acquiring location
This commit is contained in:
parent
e9af9d9b4a
commit
e068bfdb75
@ -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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user