"add contact" button for unknown contacts

Closes #1551
This commit is contained in:
Bastian Köcher
2014-06-04 01:24:44 +02:00
committed by Jake McGinty
parent b05967f2c9
commit 4a088410ae
11 changed files with 106 additions and 78 deletions

View File

@@ -29,6 +29,7 @@ import android.net.Uri;
import android.os.Handler;
import android.os.Message;
import android.provider.Contacts.Intents;
import android.provider.ContactsContract;
import android.provider.ContactsContract.QuickContact;
import android.util.AttributeSet;
import android.util.Log;
@@ -423,7 +424,9 @@ public class ConversationItem extends LinearLayout {
if (recipient.getContactUri() != null) {
QuickContact.showQuickContact(context, contactPhoto, recipient.getContactUri(), QuickContact.MODE_LARGE, null);
} else {
Intent intent = new Intent(Intents.SHOW_OR_CREATE_CONTACT, Uri.fromParts("tel", recipient.getNumber(), null));
final Intent intent = new Intent(Intent.ACTION_INSERT_OR_EDIT);
intent.putExtra(ContactsContract.Intents.Insert.PHONE, recipient.getNumber());
intent.setType(ContactsContract.Contacts.CONTENT_ITEM_TYPE);
context.startActivity(intent);
}
}