java豆子

导航

ContentResolver.query()分组查询通话记录

String[] CALL_LOG_PROJECTION = new String[] { 
                CallLog.Calls._ID,
                CallLog.Calls.NUMBER,
                CallLog.Calls.DATE,
                CallLog.Calls.DURATION,
                CallLog.Calls.TYPE,
                CallLog.Calls.CACHED_NAME,
                CallLog.Calls.CACHED_NUMBER_TYPE,
                CallLog.Calls.CACHED_NUMBER_LABEL,
                "COUNT(*) AS " + CALLS_COUNT };
String selection = "0==0) GROUP BY (" + CallLog.Calls.NUMBER;

c = resolver.query(CallLog.Calls.CONTENT_URI, CALL_LOG_PROJECTION,selection, null,CallLog.Calls.DEFAULT_SORT_ORDER + " limit "+size);

posted on 2012-09-20 18:19  java豆子  阅读(2021)  评论(0编辑  收藏  举报