@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 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 protected Dialog onCreateDialog(int id) { Dialog dialog = super.onCreateDialog(id); if (dialog != null) return dialog; switch (id) { case DIALOG_SUBSCRIPTION_REQUEST_ID: return new ConfirmDialogBuilder(this, DIALOG_SUBSCRIPTION_REQUEST_ID, this) .setMessage(subscriptionRequest.getConfirmation()) .create(); default: return null; } }