I have a view item in my RecyclerAdapter's onBindViewHolder. Since setBackgroundColor is deprecated, what should I do instead?
holder.itemView.setBackgroundColor(mContext.getResources().getColor(bgColor));
I have a view item in my RecyclerAdapter's onBindViewHolder. Since setBackgroundColor is deprecated, what should I do instead?
holder.itemView.setBackgroundColor(mContext.getResources().getColor(bgColor));
As getResources().getColor(bgColor)
is depracated
Use below one
ContextCompat.getColor(this, R.color.bgcolor)