Hi,
I'm trying to add a contact to the phone contact list, but apparaently
ContentResolver().insert() is not adding it. (The cursor's count()
method gives the same result).  My code is sth like this:

Cursor c = getContentResolver().query(
                        People.CONTENT_URI, null, null, null, null);
        startManagingCursor(c);

        columns = new String[] {People.NAME};
        names = new int[] {R.id.row_entry};

        mAdapter =
                new SimpleCursorAdapter(this, R.layout.main,
                                c, columns, names);
        setListAdapter(mAdapter);

        int count = c.count();
        ContentValues mv = new ContentValues();
        mv.put(People.NAME, "foo");
        mv.put(People.NUMBER, "54547");
        getContentResolver().insert(People.CONTENT_URI, mv);
        getContentResolver().notifyChange(People.CONTENT_URI, null);
        c.requery();
        int ccount = c.count();


'count' and 'ccount' are giving me the same values. Why is this?

thanks,
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to