hihih!
this is bug which in AndroidSourceCode is not support about column
"PHOTO_VERSION"
of People ContentProvider.
there is definition column "PHOTO_VERSION", but don't creat it as
below sourcode.
So that this Column is not exist and idxPhoto get value -1.
// Create the common people columns
HashMap<String, String> peopleColumns = new HashMap<String,
String>();
peopleColumns.put(PeopleColumns.NAME, People.NAME);
peopleColumns.put(PeopleColumns.NOTES, People.NOTES);
peopleColumns.put(PeopleColumns.TIMES_CONTACTED,
People.TIMES_CONTACTED);
peopleColumns.put(PeopleColumns.LAST_TIME_CONTACTED,
People.LAST_TIME_CONTACTED);
peopleColumns.put(PeopleColumns.STARRED, People.STARRED);
peopleColumns.put(PeopleColumns.CUSTOM_RINGTONE,
People.CUSTOM_RINGTONE);
peopleColumns.put(PeopleColumns.SEND_TO_VOICEMAIL,
People.SEND_TO_VOICEMAIL);
peopleColumns.put(PeopleColumns.DISPLAY_NAME,
DISPLAY_NAME_SQL + " AS " + People.DISPLAY_NAME);
OK!
V.Nhan!
On 1月26日, 午前5:44, Etienne <[email protected]> wrote:
> I am currently accessing the contacts from sqlite, using pre-defined
> CONTENT_URI, as described
> in:http://code.google.com/intl/fr/android/devel/data/contentproviders.ht...
>
> In Contacts.PeopleColumns, there should be a PHOTO_VERSION
> ("photo_version") column, as described
> in:http://code.google.com/intl/fr/android/reference/android/provider/Con...
>
> So, let's:
> Cursor c = getContentResolver().query(People.CONTENT_URI, null, null,
> null, " display_name ASC ");
> startManagingCursor(c);
>
> if( !c.moveToFirst()) {
> return;}
>
> int idxPhoto = c.getColumnIndex(PeopleColumns.PHOTO_VERSION);
>
> idxPhoto is set to -1... Examining c with a debugger shows that no
> such column exists in the query. Is it a documentation bug, or am I
> missing something?
>
> - Etiennewww.jamdroid.org
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---