My app has been working on a 4.0 emulator when targeted for V11 and built with the support library Fragment classes to work from V7 and up. But now that I am targeting V14 (also min SDK), I am getting the following fatal error on fragment transition animations:
E/AndroidRuntime(1098): FATAL EXCEPTION: main
E/AndroidRuntime(1098): java.lang.RuntimeException: Unknown animator name: alpha
E/AndroidRuntime(1098): at android.animation.AnimatorInflater.createAnimatorFromXml(AnimatorInflater.java:129)
E/AndroidRuntime(1098): at android.animation.AnimatorInflater.createAnimatorFromXml(AnimatorInflater.java:93)
This is the code that specifies the fragment transaction:
FragmentTransaction ft = mFrag.getFragmentManager().beginTransaction();
ft.setCustomAnimations(android.R.anim.fade_in, android.R.anim.fade_out,
android.R.anim.fade_in, android.R.anim.fade_out);
ft.replace(mParentId, frag);
ft.addToBackStack(null);
ft.commit();
Has something changed that these animations would no longer be found? Does it have something to do with not using the support library?
You just need to use
android.R.animator.fade_ininstead ofandroid.R.anim.fade_in