My ListView contains two Textviews. In one row first one is for name and second one is for result. I need to change the background color of the re
You have to do something like this,
if(Yourmark[position]<50) //Where Yourmark[] is the mark array you are passing to your custom adapter
{
holder.img.setImageResource(R.drawable.red_arrow);
holder.txtViewDescription.setBackgroundResource(R.color.resultred);
holder.txtholder.setBackgroundResource(R.color.resultred);
}
else
{
holder.img.setImageResource(R.drawable.green_arrow);
holder.txtViewDescription.setBackgroundResource(R.color.resultgreen);
holder.txtholder.setBackgroundResource(R.color.resultgreen);
}
}