setting an ImageView to invisable inside a custom Adapter
Posted
by
iyad al aqel
on Stack Overflow
See other posts from Stack Overflow
or by iyad al aqel
Published on 2011-11-27T09:44:25Z
Indexed on
2011/11/27
9:51 UTC
Read the original article
Hit count: 321
android
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);
}
© Stack Overflow or respective owner