public void handleMessage(android.os.Message msg) { dismissLoadingDialog(); switch (msg.what) { case MSG_DEAUTHORIZE_SUCCESS: Dialog dialog = DialogUtil.createMsgDialog( FacebookActivity.this, getString(R.string.deauthorize_complete), getString(R.string.confirm)); dialog.setOnDismissListener( new OnDismissListener() { @Override public void onDismiss(DialogInterface dialog) { // TODO Auto-generated method stub finish(); } }); dialog.show(); break; case MSG_DEAUTHORIZE_ERROR: String message = (String) msg.obj; DialogUtil.createMsgDialog( FacebookActivity.this, message, getString(R.string.confirm)) .show(); break; case MSG_NET_ERROR: DialogUtil.createMsgDialog( FacebookActivity.this, getString(R.string.net_error), getString(R.string.confirm)) .show(); break; } };
protected void onSessionStateChange(Session session, SessionState state, Exception exception) { LogUtil.e("go into facebook status call back"); if (exception != null && mAction != PendingAction.NONE) { DialogUtil.createMsgDialog(this, exception.getMessage(), getString(R.string.confirm)).show(); mAction = PendingAction.NONE; return; } if (session.isOpened()) { if (mAction != PendingAction.NONE) { performAction(); } } }