I have a problem with creating a GridView-based calendar. Here is the Grid:
This
I had the same problem.Keeping the setLayoutParams inside the if(view == null) clause worked out. You dont have to sacrifice view recyling in that way.
like :
if(row == null){
// inflate row
row.setLayoutParams(params);
//remaining code
}else{
holder = (ViewHolder)row.getTag();
}
// everything else
I don't know why it works but it worked for me. I also noticed that all codes regarding the same issue in stackoverflow had also used setLayoutParams outside the if clause. This is my first time so i dont know if i can post this everywhere. Hope it helped .
Source : Lot of trail and error .