@Override public void handleMessage(Message msg) { if (msg.what == USER_ADDED_ACCOUNT_SUCCESS_CODE) { try { if (null != dialog) { dialog.dismiss(); } finish(); } catch (Exception e) { e.printStackTrace(); } } else if (msg.what == USER_ADDED_ACCOUNT_FAILED_CODE) { if (null != dialog) { dialog.dismiss(); } LewaConnectionAlertDialog alertDailog = new LewaConnectionAlertDialog(LewaLoginActivity.this); alertDailog.prepareBuilder( getString(R.string.alert_dialog_login_failed), getString(R.string.alert_dialog_login_failed_result), null, getString(R.string.label_back)); alertDailog.showAlertDialog(null); } }
@Override public void onPause() { this.unregisterReceiver(this.bcr); this.unbindService(); if (null != dialog) { dialog.dismiss(); } super.onPause(); }