I\'m trying to achieve that an icon in ActionBar will not change states discretely, but by fading animation. When I add android:enterFadeDuration
and android:
This seems to be a bug that happens on specific Android versions. You can turn off the android:enterFadeDuration
programmatically in Java code, by accessing the Selector with a StateListDrawable:
// Disable android:enterFadeDuration/exitFadeDuration on Android 4.2 only
if (Build.VERSION.SDK_INT == Build.VERSION_CODES.JELLY_BEAN_MR1) {
StateListDrawable stateListDrawable =
(StateListDrawable) animatedButton.getBackground();
stateListDrawable.setEnterFadeDuration(0);
stateListDrawable.setExitFadeDuration(0);
}