ContentProvider Query Filter on Date

Problems with WiFi, SQLite ,Bluetooth, WiMax, Proxies, etc...

ContentProvider Query Filter on Date

Postby thewizzy » Thu Nov 19, 2009 6:40 am

Hi All,

I tried to query the ContentProvider CallLog to get the records for date > 1-Nov-2009.
My code is as followed:

Code: Select all
Cursor c = getContentResolver().query(android.provider.CallLog.Calls.CONTENT_URI,
              null,
              "DATE >= '2009-11-01" ,
              null,
              android.provider.CallLog.Calls.DATE + " DESC");


There is no records returned, please guide how to craft the correct filter.

thanks
thewizzy
Freshman
Freshman
 
Posts: 3
Joined: Thu Nov 19, 2009 6:26 am

Top

Postby thewizzy » Fri Nov 20, 2009 3:59 am

Finally it works!

Code: Select all
Cursor c = getContentResolver().query(android.provider.CallLog.Calls.CONTENT_URI,
             null,
             android.provider.CallLog.Calls.DATE + " >= " + calPeriod.getTimeInMillis(),
             null,
             android.provider.CallLog.Calls.DATE + " DESC");
thewizzy
Freshman
Freshman
 
Posts: 3
Joined: Thu Nov 19, 2009 6:26 am

Top

Return to Networking & Database Problems

Who is online

Users browsing this forum: No registered users and 3 guests