mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
Added CheckBoxPreference in xml
This commit is contained in:
parent
0c7c2d745e
commit
783f218706
2 changed files with 6 additions and 1 deletions
|
|
@ -7,6 +7,11 @@
|
|||
android:title="@string/preference_license"
|
||||
android:defaultValue="CC BY-SA"
|
||||
/>
|
||||
<CheckBoxPreference
|
||||
android:title="Automatically get current location"
|
||||
android:defaultValue="false"
|
||||
android:summary="Retrieve your current location to offer category suggestions if an image is not geotagged."
|
||||
android:key="allowGps" />
|
||||
|
||||
|
||||
</PreferenceScreen>
|
||||
|
|
|
|||
|
|
@ -54,8 +54,8 @@ public class GPSExtractor {
|
|||
LocationManager locationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
|
||||
Criteria criteria = new Criteria();
|
||||
String provider = locationManager.getBestProvider(criteria, true);
|
||||
|
||||
myLocationListener = new MyLocationListener();
|
||||
|
||||
locationManager.requestLocationUpdates(provider, 400, 1, myLocationListener);
|
||||
Location location = locationManager.getLastKnownLocation(provider);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue