Exemple #1
0
 @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;
   }
 }
Exemple #2
0
 @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;
   }
 }
Exemple #3
0
 @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;
   }
 }