I am trying to add a new contact to an Android phone. For this, I use the following code.
ContentValues values = new ContentValues(); values.put(Phone.RAW_CONTACT_ID, "jadeja"); values.put(Phone.NUMBER, 1234567890); values.put(Phone.TYPE, Phone.TYPE_MOBILE); Uri uri = getContentResolver().insert(Phone.CONTENT_URI, values);
But this action closes the application, and inside the "LogCat" it shows that the security permission is denied. Is there any way to achieve this?
source share