From 28e03b04910a6a8ac251bcb1df79959338c1b686 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Parm=C3=A9nides=20GV?= Date: Tue, 3 Dec 2013 18:05:19 +0100 Subject: NullPointer checks in logout Check if eipStatus and mProgressBar are null in logout(), and if so fetch the objects with findViewById. --- src/se/leap/bitmaskclient/Dashboard.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/se/leap/bitmaskclient/Dashboard.java b/src/se/leap/bitmaskclient/Dashboard.java index 103310bb..8a1a62a6 100644 --- a/src/se/leap/bitmaskclient/Dashboard.java +++ b/src/se/leap/bitmaskclient/Dashboard.java @@ -301,7 +301,9 @@ public class Dashboard extends Activity implements LogInDialog.LogInDialogInterf //if(mProgressDialog != null) mProgressDialog.dismiss(); //mProgressDialog = ProgressDialog.show(this, getResources().getString(R.string.logout_title), getResources().getString(R.string.logout_message), true); + if(mProgressBar == null) mProgressBar = (ProgressBar) findViewById(R.id.eipProgress); mProgressBar.setVisibility(ProgressBar.VISIBLE); + if(eipStatus == null) eipStatus = (TextView) findViewById(R.id.eipStatus); eipStatus.setText("Starting to logout"); //mProgressBar.setMax(1); startService(provider_API_command); -- cgit v1.2.3 From a3f9c9e1c0e79c18648d896d4f45d448ec4ef285 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Parm=C3=A9nides=20GV?= Date: Tue, 3 Dec 2013 18:55:09 +0100 Subject: Login triggered if requested after provider switch Request code for switching provider was not being considered in onActivityResult. --- src/se/leap/bitmaskclient/Dashboard.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/se/leap/bitmaskclient/Dashboard.java b/src/se/leap/bitmaskclient/Dashboard.java index 103310bb..4db53753 100644 --- a/src/se/leap/bitmaskclient/Dashboard.java +++ b/src/se/leap/bitmaskclient/Dashboard.java @@ -115,7 +115,7 @@ public class Dashboard extends Activity implements LogInDialog.LogInDialogInterf @Override protected void onActivityResult(int requestCode, int resultCode, Intent data){ - if ( requestCode == CONFIGURE_LEAP ) { + if ( requestCode == CONFIGURE_LEAP || requestCode == SWITCH_PROVIDER) { if ( resultCode == RESULT_OK ){ ConfigHelper.saveSharedPref(EIP.AUTHED_EIP, authed_eip); startService( new Intent(EIP.ACTION_UPDATE_EIP_SERVICE) ); -- cgit v1.2.3