How to filter Contacts Based on Group

by s1516 » Thu, 25 Jun 2009 01:44:12 GMT


Sponsored Links
 Hi,

I have this query which gets all people in Contacts:

// Get a cursor with all people in Contacts
Cursor c = getContentResolver().query(People.CONTENT_URI, null, null,
null, null);

But how can I filter out some result based on GROUP value?

I was thinking of using the ' String selection, String[]
selectionArgs' argument in the query, but I can't since the Database
of the is like this, It does not has GROUP as its column:

CREATE TABLE people (_id INTEGER PRIMARY KEY
AUTOINCREMENT,_sync_account TEXT,_sync_id TEXT,_sync_time
TEXT,_sync_version TEXT,_sync_local_id INTEGER,_sync_dirty INTEGER NOT
NULL DEFAULT 0,_sync_mark INTEGER,name TEXT COLLATE LOCALIZED,notes
TEXT COLLATE LOCALIZED,times_contacted INTEGER NOT NULL DEFAULT
0,last_time_contacted INTEGER,starred INTEGER NOT NULL DEFAULT
0,primary_phone INTEGER REFERENCES phones(_id),primary_organization
INTEGER REFERENCES organizations(_id),primary_email INTEGER REFERENCES
contact_methods(_id),photo_version TEXT,custom_ringtone
TEXT,send_to_voicemail INTEGER,phonetic_name TEXT COLLATE LOCALIZED);

Thank you for any help.


--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Display multiple images from a remote source in a gallery (zoomable+pannable)

If anyone has the same problem: I found a way to do it now. I had to
build my own gallery but it wasn't as hard as I feared it would be
since I found this excellent tutorial:
http://blogs.sonyericsson.com/developerworld/2010/05/26/android-one-finger-zoom-tutorial-part-2/
The best thing about it is that you can download and use the whole
source code which implements a robust framework for zooming and
panning. They only use one finger for zooming and you have to switch
between zooming and panning functionality via the options menu which
is kind of cumbersome but it's easy to change it to pinch zooming with
the help of another great tutorial:
http://www.zdnet.com/blog/burnette/how-to-use-multi-touch-in-android-2/1747
After that, adding support for multiple images isn't very hard either.

-- 

2. convert html url into western encoding

Hi,
i am parsing a string that includes a HTML Encoded URL

http://maps.google.com/maps?q=Billrothstra%DFe%2029/4,%20Austria,%201190,%20Wien

I would need the part after q=

Billrothstra%DFe%2029/4,%20Austria,%201190,%20Wien

decoded to:

"Billrothstrae 29/4, Austria, 1190, Wien"

how to? I tried   url = TextUtils.encode(url) , but didnt worked!

Its iso-8859-1

thx
chris

-- 

3. Bug/Issue tracker a joke!

4. Couple questions regarding gestures and system uis

5. Contributing a menu item to the Contact List context menu

6. Android Application memory usage monitor

7. AppWidget animation getting glitched by GC