问题描述
我试图访问Android应用程序通话记录,在这里我得到的所有呼叫的详细信息,但我想唯一的呼叫细节而已,我不想重复的值。
I am trying to access call logs in android application , here i am getting all call details but i want unique call details only , i don't want repeated values.
有没有什么办法让android系统中唯一的呼叫日志的详细信息?
is there any way to get unique call log details in android ?
推荐答案
获取所有的呼叫细节和设置
添加。设置不允许愚弄。
Get all call details and add them in Set
. Set does not allow dupes.
理念和猜测:
如果您抽取的每一个细节不同,你可能会发现更容易使用地图
然后添加键设置()
到设置
数据,然后再在填充地图。
记得在CallLog你可能会发现同一个密钥(假设联系人姓名),但该调用不同的数据(时间,持续时间等等等等)。
Idea and guess: If you are extracting each detail differently you might find easier to use Map
and then add the keySet()
to the Set
data and then again you populate the map.Remember in CallLog you might find same key (let's say Contact name) but different data for that call (Time, duration etc etc).
这篇关于获得CallLog唯一呼叫细节的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!