How to avoid duplicate contact name (data ) while loading contact info to listview?

前端 未结 7 1572
孤独总比滥情好
孤独总比滥情好 2020-12-09 10:58

I am populating contact list details to list view successfully. My code:

  String order = ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME + \" ASC\";
         


        
7条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-09 11:54

    Its because the listview is showing both normal contacts as well as whatsapp( or like this) linked contacts. Best is to store all the contacts in a Database and then retrieve the contacts using "select distinct..." command of SQL.

提交回复
热议问题