SOLVED: Find contact by phone number

Put your problem here if it does not fit any of the other categories.

SOLVED: Find contact by phone number

Postby Marcel » Sun Mar 09, 2008 4:10 pm

Hi all,

I'm looking for a way to search all phones of all contacts for a phone number. Background is that I want to save the id of the contact with that number in the database of my app. I just don't know how to make the query :-S. Maybe someone can help me with this?!

So I finally figured it out.. here's the query:
Cursor c = mContext.getContentResolver().query(Phones.CONTENT_URI, new String[] {Phones.PERSON_ID}, Phones.NUMBER + " = '" + pPhoneNumber + "' OR " + Phones.NUMBER_KEY + " = '" + pPhoneNumber + "'", null, null);


Regards,
Marcel[b]
Marcel
Freshman
Freshman
 
Posts: 9
Joined: Sun Jan 20, 2008 7:49 pm
Location: Germany

Top

Postby NithinG » Wed Mar 26, 2008 1:25 pm

hi

Can u tell me how to access the contact details which are stored to our application....

NithinG
NithinG
Developer
Developer
 
Posts: 36
Joined: Wed Feb 27, 2008 6:24 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 18 guests