diff --git a/app/src/main/java/fr/free/nrw/commons/nearby/NearbyActivity.java b/app/src/main/java/fr/free/nrw/commons/nearby/NearbyActivity.java
index c292dd802..dc9769fda 100644
--- a/app/src/main/java/fr/free/nrw/commons/nearby/NearbyActivity.java
+++ b/app/src/main/java/fr/free/nrw/commons/nearby/NearbyActivity.java
@@ -91,24 +91,23 @@ public class NearbyActivity extends BaseActivity {
protected void checkGps() {
- LocationManager manager = (LocationManager)
- getSystemService(LOCATION_SERVICE);
- if(!manager.isProviderEnabled( LocationManager.GPS_PROVIDER )) {
+ LocationManager manager = (LocationManager) getSystemService(LOCATION_SERVICE);
+ if (!manager.isProviderEnabled(LocationManager.GPS_PROVIDER)) {
Timber.d("GPS is not enabled");
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this);
- alertDialogBuilder.setMessage("GPS is disabled in your device. Would you like to enable it?")
+ alertDialogBuilder.setMessage(R.string.gps_disabled)
.setCancelable(false)
- .setPositiveButton("Enable GPS",
- new DialogInterface.OnClickListener(){
- public void onClick(DialogInterface dialog, int id){
+ .setPositiveButton(R.string.enable_gps,
+ new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int id) {
Intent callGPSSettingIntent = new Intent(
android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS);
startActivity(callGPSSettingIntent);
}
});
alertDialogBuilder.setNegativeButton("Cancel",
- new DialogInterface.OnClickListener(){
- public void onClick(DialogInterface dialog, int id){
+ new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int id) {
dialog.cancel();
}
});
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index bad2512de..479727e0e 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -51,6 +51,8 @@
Search categories
Save
Refresh
+ GPS is disabled in your device. Would you like to enable it?
+ Enable GPS
No uploads yet