Added CheckBoxPreference in xml

This commit is contained in:
misaochan 2016-02-05 15:50:59 +13:00
parent 0c7c2d745e
commit 783f218706
2 changed files with 6 additions and 1 deletions

View file

@ -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>

View file

@ -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);