Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

Simply change background of RecyclerView layout in BindViewHolder method without click an item

I have to Implement the functionality into the projects but I can't implement it because it will not change the background layout. Please suggest me the right way to solve the issue. Here BindViewHolder method for changing the background color code is

    if(list.size()!=0){
        II=Integer.parseInt(list.get(0).RideId);
        //setSelection(Integer.parseInt(list.get(0).RideId));
    }
    if(II==position){
        holder.llRoot.setBackgroundColor(Color.parseColor("#999999"));
        holder.mCarType.setTextColor(Color.parseColor("#FFFFFF"));

    }else{

        holder.llRoot.setBackgroundColor(Color.parseColor("#f3f3f3"));
        holder.mCarType.setTextColor(Color.parseColor("#2196F3"));

    }

Comments