ArrayList arReceipient = new ArrayList(); is declared globally. The arraylist is populated as follows
arReceipient.add(new MyItem(data.get(i).getId(),data.get(i).getNickName()));
Resulting in
sId 1000002327 sName htc1
sId 1000002208 sName htcandroid
sId 1000002208 sName htcandroid
sId 1000002242 sName htcandroid1
sId 1000000721 sName bachan
sId 1000000721 sName bachan
sId 1000000810 sName bachan2
How can i remove duplicates entries such that result is
sId 1000002327 sName htc1
sId 1000002208 sName htcandroid
sId 1000002242 sName htcandroid1
sId 1000000721 sName bachan
sId 1000000810 sName bachan2
Here is MyItem class
public class MyItem {
public String sId;
public String sName;
public MyItem(String sid, String sname){
this.sId=sid;
this.sName=sname;
}
}