Hi group.
...this is my third attempt... ...sigh... :-) Anyone at Google,
please...?
How can I hide contacts? By hiding I mean that the contact is not
shown in the system "Contacts" group. As I have already explained the
problem is as follows:
1) Programatically create a group
Uri uri = Contacts.Groups.CONTENT_URI;
ContentValues values = new ContentValues();
values.put(Contacts.GroupsColumns.NAME, name);
values.put(Contacts.GroupsColumns.SHOULD_SYNC, 1);
uri = cr.insert(uri, values);
2) Programaically create a contact
ContentValues personInfo = new ContentValues();
personInfo.put(Contacts.PeopleColumns.NAME, name);
ContentResolver cr = context.getContentResolver();
Uri newEntry = cr.insert(People.CONTENT_URI, personInfo);
3) add that contact to the newly created group
Cursor c = cr.query(newEntry, new String[] { BaseColumns._ID }, null,
null, null);
if ((c != null) && (c.moveToFirst())) {
long personId = c.getLong(0);
Contacts.People.addToGroup(cr, personId, groupId);
}
In the emulator the new contacts is not added to the system Contacts
group.
On a real device which of course is assigned to a Google
account, however, the new contact becomes member of the system
Contacts group, too, which is not what I want, because the new
contact
should not be displayed in the Contacts application, unless, of
course, the users switches to my newly creatd group.
Please help.
Regards
Thomas
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---