| 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 |