setting an ImageView to invisable inside a custom Adapter
- by iyad al aqel
i'm defining my own list adapter and i want an image inside it to be shown OR hidden based on a value what i've noticed that its always invisible or visible disregarding the value
Here's my code , this code is inside the getView method
singleRow=data.get(position);
readit = singleRow.getRead();
Log.i("readit","" + readit );
//NotificationID=singleRow.getId();
holder.title.setText(singleRow.getAttach_title());
holder.date.setText( singleRow.getAttach_created());
holder.dueDate.setVisibility(ImageView.INVISIBLE);
holder.course.setText(singleRow.getCourse_title());
if(readit==1)
{
//holder.read.setImageResource(IGNORE_ITEM_VIEW_TYPE);
holder.read.setVisibility(ImageView.INVISIBLE);
}
else
{
holder.read.setImageResource(R.drawable.unread);
}