I have a problem with creating a GridView-based calendar. Here is the Grid:
This
Ok, I found the solution. The problem was these lines:
ViewHolder holder;
if (convertView == null)
{
holder = new ViewHolder();
LayoutInflater inflater = (LayoutInflater) _context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = inflater.inflate(R.layout.calendar_day_gridcell, parent, false);
holder.gridCell = (Button) convertView.findViewById(R.id.calendar_day_gridcell_button);
holder.multiDayEvent = (EventLengthView) convertView.findViewById(R.id.eventLengthView);
convertView.setTag(holder);
}
else {
holder = (ViewHolder) convertView.getTag();
}
When putting instatiating the gridCell button there, somehow, it mixes up the click listener of the first position in the adapter. I ended up fixing it by just instatiating the holder in every pass, instead of getting it by tag (which is better for performance, but oh well). Thanks everyone for the help.