Ejemplo n.º 1
0
    @Override
    protected void onPostExecute(Long resultThread) {
      if (resultThread > -1) {
        Intent intent = new Intent(GroupCreateActivity.this, ConversationActivity.class);
        intent.putExtra(ConversationActivity.THREAD_ID_EXTRA, resultThread.longValue());
        intent.putExtra(
            ConversationActivity.DISTRIBUTION_TYPE_EXTRA, ThreadDatabase.DistributionTypes.DEFAULT);

        ArrayList<Recipient> selectedContactsList = setToArrayList(selectedContacts);
        intent.putExtra(
            ConversationActivity.RECIPIENTS_EXTRA,
            RecipientFactory.getRecipientsFor(GroupCreateActivity.this, selectedContactsList, true)
                .getIds());
        startActivity(intent);
        finish();
      } else {
        Toast.makeText(
                getApplicationContext(),
                R.string.GroupCreateActivity_contacts_mms_exception,
                Toast.LENGTH_LONG)
            .show();
        finish();
      }
    }
Ejemplo n.º 2
0
 private long handleCreateMmsGroup(Set<Recipient> members) {
   Recipients recipients =
       RecipientFactory.getRecipientsFor(this, new LinkedList<>(members), false);
   return DatabaseFactory.getThreadDatabase(this)
       .getThreadIdFor(recipients, ThreadDatabase.DistributionTypes.CONVERSATION);
 }