From 7bb058b2f4c65f553313a19bac2187ffe231f6e5 Mon Sep 17 00:00:00 2001 From: Andrew Gillard Date: Sun, 15 Apr 2012 18:56:39 +0100 Subject: [PATCH] Login activity tweaks. --- .../quasseldroid/gui/LoginActivity.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/com/iskrembilen/quasseldroid/gui/LoginActivity.java b/src/com/iskrembilen/quasseldroid/gui/LoginActivity.java index 2d68579f..23161907 100644 --- a/src/com/iskrembilen/quasseldroid/gui/LoginActivity.java +++ b/src/com/iskrembilen/quasseldroid/gui/LoginActivity.java @@ -151,11 +151,10 @@ public void onCreate(Bundle savedInstanceState) { @Override protected void onReceiveResult(int resultCode, Bundle resultData) { - if (resultCode==CoreConnService.CONNECTION_CONNECTED) { - // Already connected (probably the app being launched again while already connected) - LoginActivity.this.startActivity(new Intent(LoginActivity.this, BufferActivity.class)); - } else if (resultCode==CoreConnService.CONNECTION_CONNECTING) { - removeDialog(R.id.DIALOG_CONNECTING); + if (resultCode==CoreConnService.CONNECTION_CONNECTED || + resultCode==CoreConnService.CONNECTION_CONNECTING) { + // Just connected or already connected (probably the + // app being launched again while already connected) Intent bufferIntent = new Intent(LoginActivity.this, BufferActivity.class); if (sharedString != null && sharedString.length() > 0) { bufferIntent.putExtra(BufferActivity.BUFFER_SHARE_EXTRA_TEXT, sharedString); @@ -164,6 +163,11 @@ protected void onReceiveResult(int resultCode, Bundle resultData) { } sharedString = null; sharedUri = null; + + if (resultCode==CoreConnService.CONNECTION_CONNECTING) { + // Remove the dialog if we've just finished connecting + removeDialog(R.id.DIALOG_CONNECTING); + } LoginActivity.this.startActivity(bufferIntent); }else if (resultCode==CoreConnService.CONNECTION_DISCONNECTED) { if (resultData!=null){