From 0af03bb456d193fb51e23ec3bb438decef3f01cf Mon Sep 17 00:00:00 2001 From: Josephine Lim Date: Mon, 15 May 2017 10:39:56 +0200 Subject: [PATCH] Refresh view if settings changed --- .../fr/free/nrw/commons/nearby/NearbyActivity.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 dc9769fda..6a9516a83 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 @@ -102,7 +102,7 @@ public class NearbyActivity extends BaseActivity { public void onClick(DialogInterface dialog, int id) { Intent callGPSSettingIntent = new Intent( android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS); - startActivity(callGPSSettingIntent); + startActivityForResult(callGPSSettingIntent, 1); } }); alertDialogBuilder.setNegativeButton("Cancel", @@ -119,6 +119,14 @@ public class NearbyActivity extends BaseActivity { } } + @Override + protected void onActivityResult(int requestCode, int resultCode, Intent data) { + super.onActivityResult(requestCode, resultCode, data); + if (resultCode == 1) { + refreshView(); + } + } + private void showMapView() { if (!isMapViewActive) { isMapViewActive = true;