From 312ca279063b5b8d2446b1b6ae38d9e68662cc9c Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Thu, 13 Nov 2014 21:22:45 -0800 Subject: [PATCH] Open the app list after successfully pairing --- app/src/main/java/com/limelight/PcView.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/limelight/PcView.java b/app/src/main/java/com/limelight/PcView.java index e6096104..0366569d 100644 --- a/app/src/main/java/com/limelight/PcView.java +++ b/app/src/main/java/com/limelight/PcView.java @@ -295,6 +295,7 @@ public class PcView extends Activity { public void run() { NvHTTP httpConn; String message; + boolean success = false; try { // Stop updates and wait while pairing stopComputerUpdates(true); @@ -312,7 +313,9 @@ public class PcView extends Activity { PlatformBinding.getDeviceName(), PlatformBinding.getCryptoProvider(PcView.this)); if (httpConn.getPairState() == PairingManager.PairState.PAIRED) { - message = "Already paired"; + // Don't display any toast, but open the app list + message = null; + success = true; } else { final String pinStr = PairingManager.generatePinString(); @@ -329,6 +332,7 @@ public class PcView extends Activity { } else if (pairState == PairingManager.PairState.PAIRED) { message = "Paired successfully"; + success = true; } else { // Should be no other values @@ -348,10 +352,18 @@ public class PcView extends Activity { Dialog.closeDialogs(); final String toastMessage = message; + final boolean toastSuccess = success; runOnUiThread(new Runnable() { @Override public void run() { - Toast.makeText(PcView.this, toastMessage, Toast.LENGTH_LONG).show(); + if (toastMessage != null) { + Toast.makeText(PcView.this, toastMessage, Toast.LENGTH_LONG).show(); + } + + if (toastSuccess) { + // Open the app list after a successful pairing attemp + doAppList(computer); + } } });