From 6594886a21f989d290b421f4502536a30ed443b9 Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 6 May 2018 10:51:45 +0200 Subject: [PATCH] Revert "Refactoring" This reverts commit bcba2783c878f550fbb203bc7a312b8904a15b94. --- app/src/main/java/eu/faircode/netguard/ActivityMain.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/faircode/netguard/ActivityMain.java b/app/src/main/java/eu/faircode/netguard/ActivityMain.java index d4be35e0..7cb71bbb 100644 --- a/app/src/main/java/eu/faircode/netguard/ActivityMain.java +++ b/app/src/main/java/eu/faircode/netguard/ActivityMain.java @@ -339,7 +339,8 @@ public class ActivityMain extends AppCompatActivity implements SharedPreferences registerReceiver(packageChangedReceiver, intentFilter); // First use - if (!initialized) { + boolean admob = prefs.getBoolean("admob", false); + if (!initialized || !admob) { // Create view LayoutInflater inflater = LayoutInflater.from(this); View view = inflater.inflate(R.layout.first, null, false); @@ -360,7 +361,7 @@ public class ActivityMain extends AppCompatActivity implements SharedPreferences public void onClick(DialogInterface dialog, int which) { if (running) { prefs.edit().putBoolean("initialized", true).apply(); - initAds(); + prefs.edit().putBoolean("admob", true).apply(); } } }) @@ -414,6 +415,9 @@ public class ActivityMain extends AppCompatActivity implements SharedPreferences Log.e(TAG, ex.toString() + "\n" + Log.getStackTraceString(ex)); } + // Initialize ads + initAds(); + // Handle intent checkExtras(getIntent()); }