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: Created Nov. 7, 2013, 2:29 p.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,13 @@
current = subscriptions[0];
}
- boolean firstRun = false;
- if (application.isFirstRun())
+ boolean firstRun = firstRunActionsPending && application.isFirstRun();
+ 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
@@ -191,6 +190,7 @@
setProxyEnabled(true);
bindService(new Intent(this, ProxyService.class), proxyServiceConnection, 0);
+ firstRunActionsPending = false;
Wladimir Palant 2013/11/08 06:08:20 IMHO it's better to group related operations - I w
Felix Dahlke 2013/11/08 08:37:36 Hehe, I was actually pondering that :) I'd prefer
}
@Override
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld