Sorted list of contacts having duplicates ,why?

前端 未结 7 1181
青春惊慌失措
青春惊慌失措 2020-12-07 02:26

I have sorted and listed my phone contacts in to an arraylist but ,i got many duplicates of same contact names in the list .How this happens? how to avoid this?

This

7条回答
  •  不思量自难忘°
    2020-12-07 02:59

    I don't know why are you getting duplicate items from contacts, maybe phone contacts already have duplicate values.You can check that in Contacts app.

    You should always use set data structure wherever you want to avoid duplicate items. You can find the better explanation and example here.

提交回复
热议问题