From 6ed54484a64d83af1317648d9640f7436ad105f2 Mon Sep 17 00:00:00 2001 From: Andreas Shimokawa Date: Tue, 11 Aug 2015 14:16:08 +0200 Subject: [PATCH] Pebble: only fill app list in AppManager with cached apps once in onCreate() This is important for FW 3.x testing, since the REFRESH intent will never arrive and we want to see cached watchapps --- .../activities/AppManagerActivity.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/AppManagerActivity.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/AppManagerActivity.java index db93a0ef..6a53276a 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/AppManagerActivity.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/AppManagerActivity.java @@ -55,15 +55,6 @@ public class AppManagerActivity extends Activity { appList.add(new GBDeviceApp(uuid, appName, appCreator, "", appType)); } - - SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(GBApplication.getContext()); - - if (sharedPrefs.getBoolean("pebble_force_untested", false)) { - List cachedApps = getCachedApps(); - for (GBDeviceApp app : cachedApps) { - appList.add(app); - } - } mGBDeviceAppAdapter.notifyDataSetChanged(); } } @@ -111,6 +102,15 @@ public class AppManagerActivity extends Activity { }); registerForContextMenu(appListView); + + SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(GBApplication.getContext()); + + if (sharedPrefs.getBoolean("pebble_force_untested", false)) { + List cachedApps = getCachedApps(); + for (GBDeviceApp app : cachedApps) { + appList.add(app); + } + } IntentFilter filter = new IntentFilter(); filter.addAction(ControlCenter.ACTION_QUIT);