开发者

Getting the DISTINCT most recently contacted contacts from Call Log

Since it is not possible to use DISTINCT whil开发者_C百科e querying the CallLog.Calls.CONTENT_URI, what can be a good workaround for getting the distinct most recently contacted contacts from the call logs?


It wouldn't be a GET distinct, but if you got them then stored them into a Set, say a TreeSet you'd be left with a distinct list.

HTH


    Cursor cursor = getActivity().getContentResolver().query(ContactsContract.Contacts.CONTENT_URI, null, "TIMES_CONTACTED>0", null, "CONTACT_LAST_UPDATED_TIMESTAMP DESC");

Use this cursor query.I am assuming that you have used Hash Set to remove duplicate contacts.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜