Android ListView arraylist group items of different positions by comparing with second arraylist -
Android ListView arraylist group items of different positions by comparing with second arraylist -
i displaying weekly info in listview. current week dates using java calendar class. getting info have display list within arraylist custom objects.
bean class :
public class samplebean{ string date; string day; string city; ............................ // getters , setters }
that array details contains 7 dates, 1 date can @ multiple positions. e.g date 21 oct 2014 @ positions 3,4 , 5.
since need show weekly view, have grouping items @ positions same date , display them in single row of listview - " city1, city2, city3" - separated coma. want accomplish comparing arraylist dates calendar custom arraylist info display in listview
my listview needs size of 7. array items same dates need grouped together. that, unable grind out logic. looping patterns have been buggy altogether.
if give me idea, sample, or link how go on accomplish grouping appreciated.
i achieved solution using using count of recurrences of specific date , using count iterate though loop combine items.
android-listview arraylist
Comments
Post a Comment