I have a List of custom objects. These objects holds reservation information for the past 2 years (for each day). It is a really big list with about 730 (365+365) items.
I have also a grid view with day cells (like calendar) and i want to draw different things in each day if they meet certain conditions.
The problem is that for each cell in getView i have to loop this large list.
@Override
public View getView(int position, View convertView, ViewGroup parent)
{
...
String date = dateList.get(position).getDate();
for(Reservation item: reallyBigList){
if(item.getDate.equals(date)){
...
break;
}
}
...
}
This approach make my list very laggy. I am looking for a most efficient way to accomplish this. One solution i can think is to split this large list. But i want to know if there is any other way.