Code example for ContentValues

Methods: insertput

1
        Log.i(TAG, "Created");
        m_context = context;
    } 
 
    private void makeContactsVisible(Account account) {
        ContentValues values = new ContentValues();
        values.put(ContactsContract.RawContacts.ACCOUNT_TYPE, account.type);
        values.put(ContactsContract.RawContacts.ACCOUNT_NAME, account.name);
        values.put(ContactsContract.Settings.UNGROUPED_VISIBLE, true);
 
        m_context.getContentResolver().insert(ContactsContract.Settings.CONTENT_URI, values);
    } 
 
    private void syncPerson(Account account,
                            JSONObject person,
                            ContentResolver resolver,
                            List<ContentProviderOperation> operations) throws Exception {
 
        SyncOperation op = new SyncOperation(m_context, resolver, account, person.getString("id"), operations);
        op.setNickname(person.getString("preferredUsername"));
        if(person.has("displayName")) op.setDisplayName(person.getString("displayName"));