From bdd4fc1575b2025fe9545f2fc5c8230638912ced Mon Sep 17 00:00:00 2001 From: OliE Date: Sat, 13 Jan 2018 12:02:53 +0100 Subject: [PATCH] move AlertDialog variable to the right place. --- .../src/main/java/com/health/openscale/gui/MainActivity.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/android_app/app/src/main/java/com/health/openscale/gui/MainActivity.java b/android_app/app/src/main/java/com/health/openscale/gui/MainActivity.java index b34e95c9..a80305b5 100644 --- a/android_app/app/src/main/java/com/health/openscale/gui/MainActivity.java +++ b/android_app/app/src/main/java/com/health/openscale/gui/MainActivity.java @@ -124,8 +124,6 @@ public class MainActivity extends AppCompatActivity { prefs.edit().putBoolean("firstStart", false).commit(); } - AlertDialog.Builder builder = new AlertDialog.Builder(this); - if(!valueOfCountModified){ int launchCount = prefs.getInt("launchCount", 0); @@ -134,6 +132,8 @@ public class MainActivity extends AppCompatActivity { // ask the user once for feedback on the 30th app launch if(launchCount == 30){ + AlertDialog.Builder builder = new AlertDialog.Builder(this); + builder.setMessage(R.string.label_feedback_message_enjoying) .setPositiveButton(R.string.label_feedback_message_yes, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) {