Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: src/org/adblockplus/android/Preferences.java

Issue 28457002: Only execute first run logic once (Closed)
Patch Set: Move firstRunActionsPending = false up Created Nov. 8, 2013, 8:37 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/org/adblockplus/android/Preferences.java
===================================================================
--- a/src/org/adblockplus/android/Preferences.java
+++ b/src/org/adblockplus/android/Preferences.java
@@ -66,6 +66,8 @@
private static ProxyService proxyService = null;
+ private static boolean firstRunActionsPending = true;
+
private RefreshableListPreference subscriptionList;
private String subscriptionSummary;
@@ -139,16 +141,15 @@
current = subscriptions[0];
}
- boolean firstRun = false;
- if (application.isFirstRun())
+ boolean firstRun = firstRunActionsPending && application.isFirstRun();
+ firstRunActionsPending = false;
+
+ if (firstRun && current != null)
{
- firstRun = true;
-
- if (current != null)
- {
- new AlertDialog.Builder(this).setTitle(R.string.app_name).setMessage(String.format(getString(R.string.msg_subscription_offer, current.title))).setIcon(android.R.drawable.ic_dialog_info)
- .setPositiveButton(R.string.ok, null).create().show();
- }
+ new AlertDialog.Builder(this).setTitle(R.string.app_name)
+ .setMessage(String.format(getString(R.string.msg_subscription_offer, current.title)))
+ .setIcon(android.R.drawable.ic_dialog_info)
+ .setPositiveButton(R.string.ok, null).create().show();
}
// Enable manual subscription refresh
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld