I need to remove shadow from a button. Since it is created in java (not in xml) I can't see the option to do so. I know the following line can be used in xml.
android:stateListAnimator="@null"
Tried the same in java as follows.
myButton.setStateListAnimator(null);
But the problem is, it will work only on devices with 21 API or above. Is there any alternative way?