Skip to content

Instantly share code, notes, and snippets.

@skatldjs
Created October 22, 2010 05:11
Show Gist options
  • Save skatldjs/639982 to your computer and use it in GitHub Desktop.
Save skatldjs/639982 to your computer and use it in GitHub Desktop.
import android.provider.Contacts.People;
import android.content.ContentResolver;
import android.content.ContentValues;
ContentValues values = new ContentValues();
// Add Abraham Lincoln to contacts and make him a favorite.
values.put(People.NAME, "Abraham Lincoln");
// 1 = the new contact is added to favorites
// 0 = the new contact is not added to favorites
values.put(People.STARRED, 1);
Uri uri = getContentResolver().insert(People.CONTENT_URI, values);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment