Exemplo n.º 1
0
 @Override
 protected void onPostExecute(Pair<Long, Recipients> groupInfo) {
   super.onPostExecute(groupInfo);
   final long threadId = groupInfo.first;
   final Recipients recipients = groupInfo.second;
   if (threadId > -1) {
     Intent intent = new Intent(GroupCreateActivity.this, ConversationActivity.class);
     intent.putExtra(ConversationActivity.THREAD_ID_EXTRA, threadId);
     intent.putExtra(
         ConversationActivity.DISTRIBUTION_TYPE_EXTRA, ThreadDatabase.DistributionTypes.DEFAULT);
     intent.putExtra(ConversationActivity.RECIPIENTS_EXTRA, recipients.getIds());
     startActivity(intent);
     finish();
   } else if (threadId == RES_BAD_NUMBER) {
     Toast.makeText(
             getApplicationContext(),
             R.string.GroupCreateActivity_contacts_invalid_number,
             Toast.LENGTH_LONG)
         .show();
     disableWhisperGroupProgressUi();
   } else if (threadId == RES_MMS_EXCEPTION) {
     Toast.makeText(
             getApplicationContext(),
             R.string.GroupCreateActivity_contacts_mms_exception,
             Toast.LENGTH_LONG)
         .show();
     finish();
   }
 }
Exemplo n.º 2
0
 @Override
 protected void onPostExecute(Pair<Long, Recipients> groupInfo) {
   final long threadId = groupInfo.first;
   final Recipients recipients = groupInfo.second;
   if (threadId > -1) {
     Intent intent = getIntent();
     intent.putExtra(GROUP_THREAD_EXTRA, threadId);
     intent.putExtra(GROUP_RECIPIENT_EXTRA, recipients.getIds());
     setResult(RESULT_OK, intent);
     finish();
   } else if (threadId == RES_BAD_NUMBER) {
     Toast.makeText(
             getApplicationContext(),
             R.string.GroupCreateActivity_contacts_invalid_number,
             Toast.LENGTH_LONG)
         .show();
     disableWhisperGroupProgressUi();
   } else if (threadId == RES_MMS_EXCEPTION) {
     Toast.makeText(
             getApplicationContext(),
             R.string.GroupCreateActivity_contacts_mms_exception,
             Toast.LENGTH_LONG)
         .show();
     setResult(RESULT_CANCELED);
     finish();
   }
 }