I'm seeing some very strange behaviour from the GroupMembership
provider. I'm trying to filter for the members of a single group, but
(depending on the group ID I filter on) my query results come back
with either too many people (some people appear twice, with group IDs
that should be excluded by my filter), or no people at all.
I only see this problem on the G1. I have failed to reproduce it in
the emulator. I hope that I have just made some SQL syntax error, but
I've tried hard to find one & failed.
Could this be a bug in the content provider ? Or, what stupid thing
have I done wrong ?
Here's the code that sets up the query:
String filterString = GroupMembership.GROUP_ID + " = " + String.valueOf
( mGroupFilter );
mCursor = getContentResolver().query(GroupMembership.CONTENT_URI,
new String[] {GroupMembership._ID,
GroupMembership.PERSON_ID,
GroupMembership.GROUP_ID},
filterString ,
null,
null);
mPeopleIdColumn = mCursor.getColumnIndex(GroupMembership.PERSON_ID );
mGroupIdColumn = mCursor.getColumnIndex(GroupMembership.GROUP_ID);
logCursor( );
Here's the logging function:
private void logCursor()
{
if( mCursor.moveToFirst())
{
do
{
String r;
r = "row ";
r += String.valueOf( mCursor.getPosition());
r += " - personId: ";
r += String.valueOf( mCursor.getString(
mPeopleIdColumn));
r += " - groupId: ";
r += String.valueOf( mCursor.getString(
mGroupIdColumn));
Log.i("logCursor", r);
}
while( mCursor.moveToNext());
}
}
And here is the output when I filter for group ID 2. Note that there
are entries for group ID 3, which should have been forbidden by the
filter:
row 0 - personId: 12 - groupId: 2
row 1 - personId: 12 - groupId: 3
row 2 - personId: 21 - groupId: 2
row 3 - personId: 44 - groupId: 2
row 4 - personId: 57 - groupId: 2
row 5 - personId: 57 - groupId: 3
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---