In API23 and earlier,
getResources().getColor(R.color.idname);
You can do it like this.
In API23 and later versions,
getResources().getColorStateList(id)
ContextCompat.getColorStateList(getContext(),id);
You can do it like this.
© 2024 OneMinuteCode. All rights reserved.