getContentResolver().query selection args

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

getContentResolver().query selection args

Postby ting-tong » Mon Mar 07, 2011 1:37 pm

Hi, new to the forum, I hope it's the right place to post this. :D

I am trying to get data from the CallLog content provier. I am able to do the basic stuffs but stuck at the moment with the query. Here's the code I am using. This works perfectly and returns the call log of all incoming call. However, If i want to get the incoming call log for a particular number, I am not able to query it correctly? Is it possible to specify multiple selection args in the query to specify that I need CallLog.Calls.INCOMING_TYPE and would supply a number for CallLog.Calls.NUMBER at runtime. I have tried several queries but must be doing something wrong (syntax?). Any help with this guys? Thanks a lot.

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. Cursor c = getContentResolver().query(CallLog.Calls.CONTENT_URI, null,
  2.                     CallLog.Calls.TYPE + "=?",
  3.                     new String[] { String.valueOf(CallLog.Calls.INCOMING_TYPE) },
  4.                     ORDER_BY);
  5.  
Parsed in 0.031 seconds, using GeSHi 1.0.8.4
ting-tong
Freshman
Freshman
 
Posts: 2
Joined: Mon Dec 27, 2010 11:16 pm

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Yahoo [Bot] and 19 guests