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. setResult of an activity

Hi,

For example i hav some 3 activities.. activity 1 is the main screen
and iam in activity 2.. another activity is started by handler and the
result of activity3 ahould go bak to activity 1.. but since 2 is on
top of stack, activity 1 is not getting the result of 3... how to
solve this

-- 

2. Send a bookmarkable link via MMS

Hi!

I've had a hunt around through various forums and dev guides for
Android, and I'm fairly sure this is not possible but it never hurts
to ask!

I know you can send a link to a web page via MMS, but is it possible
on Android to bookmark the link automatically if the user clicks the
link?

i.e
User receives a MMS with a link to example.com and a link saying
"Bookmark now!"
User clicks "Bookmark now!" and a bookmark is created in the browser
(or on the home screen)

I'm fairly certain this behavior would be allowed, but does anyone
know for sure?

Thanks,
Cranz

-- 

3. TimePicker theme

4. Stolen app on market

5. Issue with Catch Handler

6. Images from drawable-nodpi getting scale

7. How to start a background service on install