संभव डुप्लिकेट संपर्क बनाने के लिए कैसे:
How to add new contacts in androidप्रोग्राम के रूप में
public boolean createContact(String name, String number, String email)
{
boolean success = true;
try
{
ContentValues contentValues = new ContentValues();
ContentResolver contentResolver = getContentResolver();
contentValues.put(Data.MIMETYPE, Phone.CONTENT_ITEM_TYPE);
contentValues.put(Phone.NUMBER, "123254");
Uri uri = contentResolver.insert(android.provider.ContactsContract.Data.CONTENT_URI, contentValues);
if(uri==null)
{
success = false;
}
}
catch (Exception e)
{
e.printStackTrace();
success = false;
}
return success;
}
मैं NullPointer अपवाद मैं नहीं जानता कि क्यों मैं भी WRITE_CONTACTS अनुमति निर्दिष्ट किया है हो रही है। कृपया मेरी मदद करें ............
मैं न ** android.provider.Contacts उपयोग करना चाहते हैं ** मैं ** android.provider.ContactContracts उपयोग कर एक संपर्क बनाना चाहते हैं ** –
सौभाग्य http://stackoverflow.com/questions/4744187/ कैसे-टू-एड-न्यू-कॉन्टैक्ट-इन-एंड्रॉइड – lnu
आप किस एसडीके संस्करण का उपयोग कर रहे हैं? –