diff --git a/app/src/main/java/com/limelight/AppView.java b/app/src/main/java/com/limelight/AppView.java index 2c923c48..8f993069 100644 --- a/app/src/main/java/com/limelight/AppView.java +++ b/app/src/main/java/com/limelight/AppView.java @@ -81,11 +81,8 @@ public class AppView extends Activity implements AdapterFragmentCallbacks { // Wait for the binder to be ready localBinder.waitForReady(); - // Now make the binder visible - managerBinder = localBinder; - // Get the computer object - computer = managerBinder.getComputer(UUID.fromString(uuidString)); + computer = localBinder.getComputer(UUID.fromString(uuidString)); if (computer == null) { finish(); return; @@ -95,13 +92,18 @@ public class AppView extends Activity implements AdapterFragmentCallbacks { appGridAdapter = new AppGridAdapter(AppView.this, PreferenceConfiguration.readPreferences(AppView.this).listMode, PreferenceConfiguration.readPreferences(AppView.this).smallIconMode, - computer, managerBinder.getUniqueId()); + computer, localBinder.getUniqueId()); } catch (Exception e) { e.printStackTrace(); finish(); return; } + // Now make the binder visible. We must do this after appGridAdapter + // is set to prevent us from reaching updateUiWithServerinfo() and + // touching the appGridAdapter prior to initialization. + managerBinder = localBinder; + // Load the app grid with cached data (if possible). // This must be done _before_ startComputerUpdates() // so the initial serverinfo response can update the running