I want to change ImageView background (in my case gradient color) using selector state programmatically not by using xml file.
I want pressed and default state to my ImageView
For creating gradient background I use this code:
GradientDrawable gd = new GradientDrawable(
GradientDrawable.Orientation.BOTTOM_TOP,
new int[] {Color.parseColor(startColour), Color.parseColor(endColour)});
How can I implement selector for this?
Thanks