What is the problem you are facing? You have the phone number of each
call-log entry. Why you cannot group together the ones with the same
phone number? Just iterate over all entries in the call-log and do
whatever you wish to do with them. But beware, you should do such
operation in a seperate thread, and not in the main thread.
In an app which I developed, I access all call-log entries like below.
Something similar should work for you also. Inside the do-while loop
you can do whatever you wish with the call-log entries.
/////////////////////////////////////////
// This code should be executed in a seperate thread.
String[] projCallLog = new String[] { CallLog.Calls._ID,
CallLog.Calls.CACHED_NAME, CallLog.Calls.TYPE, CallLog.Calls.NUMBER,
CallLog.Calls.CACHED_NUMBER_TYPE, CallLog.Calls.DATE };
Cursor cur = getContentResolver().query(CallLog.Calls.CONTENT_URI,
projCallLog, null, null, CallLog.Calls.DEFAULT_SORT_ORDER);
if (null == cur)
return (null);
if (!cur.moveToFirst())
{
cur.close();
return (null);
}
do
{
// ...
// You can make the call-log entries even dance here :-)
// ...
} while (cur.moveToNext());
cur.close();
/////////////////////////////////////////
-------------------------------------------------
Ali Chousein
Weather-Buddy
http://weatherbuddy.blogspot.com/ | http://twitter.com/weather_buddy
Geo-Filtered Assistant
http://geo-filtered-assistant.blogspot.com/
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en