setForeground notWorking what to use instead or setForeground is not working in higher Andorid versions or set background color in view or Layout in Andorid versions.

This is older:
holder.rootView.setForeground(new 
ColorDrawable(ContextCompat.getColor(context,R.color.colorControlActivated)));

Support in higher Andorid versions try this :
holder.rootView.setBackgroundColor(ContextCompat.getColor(mContext, R.color.grey_40));




Comments

Popular posts from this blog

Lint found fatal errors while assembling a release target.

Windows 7 all Version 64-Bit iso file Download with crack activation. (Google Drive Link)

ViewModelProviders.of(this) is deprecated what to use instead ViewModelProviders.of(this) OR if you don't want to use ViewmodelFactory OR ViewModelProviders error.