@Override protected void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); outState.putString(SAVED_ACCOUNT, (String) accountView.getSelectedItem()); outState.putString(SAVED_USER, userView.getText().toString()); outState.putString(SAVED_NAME, nameView.getText().toString()); }
@Override public void onCancel(DialogBuilder dialogBuilder) { super.onCancel(dialogBuilder); switch (dialogBuilder.getDialogId()) { case DIALOG_SUBSCRIPTION_REQUEST_ID: finish(); break; } }
@Override public void onDecline(DialogBuilder dialogBuilder) { super.onDecline(dialogBuilder); switch (dialogBuilder.getDialogId()) { case DIALOG_SUBSCRIPTION_REQUEST_ID: try { PresenceManager.getInstance() .discardSubscription(subscriptionRequest.getAccount(), subscriptionRequest.getUser()); } catch (NetworkException e) { Application.getInstance().onError(e); } finish(); break; } }
@Override public void onAccept(DialogBuilder dialogBuilder) { super.onAccept(dialogBuilder); switch (dialogBuilder.getDialogId()) { case DIALOG_SUBSCRIPTION_REQUEST_ID: try { PresenceManager.getInstance() .acceptSubscription(subscriptionRequest.getAccount(), subscriptionRequest.getUser()); } catch (NetworkException e) { Application.getInstance().onError(e); } getIntent().setAction(null); break; } }
@Override protected void onResume() { super.onResume(); if (subscriptionRequest != null) showDialog(DIALOG_SUBSCRIPTION_REQUEST_ID); }