Best way to Remove Duplicate value from arraylist in Android 

The easiest way to remove repeated elements is to add the contents to a Set (which will not allow duplicates) and then add the Set back to the ArrayList:

Here my arraylist is beforedate array

HashSet hs = new HashSet();

        hs.addAll(beforeDateArray);
        beforeDateArray.clear();
        beforeDateArray.addAll(hs);

Recent Comments

0 Comments

Sign In To Leave a Comment

Type your Comment below and click to send comment

error: function(jqXHR, textStatus, errorThrown) { alert(errorThrown); }