예제 #1
0
 protected void onActivityResult(int requestCode, int resultCode, final Intent data) {
   super.onActivityResult(requestCode, resultCode, data);
   if (requestCode == REQUEST_INVITE_TO_CONVERSATION && resultCode == RESULT_OK) {
     mPendingConferenceInvite = ConferenceInvite.parse(data);
     if (xmppConnectionServiceBound && mPendingConferenceInvite != null) {
       mPendingConferenceInvite.execute(this);
       mPendingConferenceInvite = null;
     }
   }
 }
예제 #2
0
 public static ConferenceInvite parse(Intent data) {
   ConferenceInvite invite = new ConferenceInvite();
   invite.uuid = data.getStringExtra("conversation");
   if (invite.uuid == null) {
     return null;
   }
   try {
     if (data.getBooleanExtra("multiple", false)) {
       String[] toAdd = data.getStringArrayExtra("contacts");
       for (String item : toAdd) {
         invite.jids.add(Jid.fromString(item));
       }
     } else {
       invite.jids.add(Jid.fromString(data.getStringExtra("contact")));
     }
   } catch (final InvalidJidException ignored) {
     return null;
   }
   return invite;
 }