From b48f788f8590a9520d79e0537dba21610dd899d4 Mon Sep 17 00:00:00 2001 From: alexzatsepin Date: Mon, 16 Jan 2017 10:56:16 +0300 Subject: [PATCH] [andorid] Extracted location error dialog creation to the separate method --- android/src/com/mapswithme/maps/MwmActivity.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/android/src/com/mapswithme/maps/MwmActivity.java b/android/src/com/mapswithme/maps/MwmActivity.java index c9faa10a39..9d2a2c1bf4 100644 --- a/android/src/com/mapswithme/maps/MwmActivity.java +++ b/android/src/com/mapswithme/maps/MwmActivity.java @@ -1769,7 +1769,11 @@ public class MwmActivity extends BaseMwmFragmentActivity return; } - final Intent finIntent = intent; + showLocationErrorDialog(intent); + } + + private void showLocationErrorDialog(@NonNull final Intent intent) + { new AlertDialog.Builder(this) .setTitle(R.string.enable_location_services) .setMessage(R.string.location_is_disabled_long_text) @@ -1795,7 +1799,7 @@ public class MwmActivity extends BaseMwmFragmentActivity public void onClick(DialogInterface dialog, int which) { //TODO: try to use startActivityForResult to handle settings result back - startActivity(finIntent); + startActivity(intent); } }).show(); }