I've been programming with Android Studio for a long time, I do not like to use a lot of XML, so Animations usually create them in java but what I realized is that with the FragmentManager
there is not a method to place it, it touches by XML with the setTransition
like this:
MainActivity.java
FragmentManager FM=getSupportFragmentManager();
FM.beginTransaction().setTransition(R.anim.fadein).replace(R.id.root,new BlankFragment()).commit();
fadein.xml
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<alpha
android:fromAlpha="0.0"
android:toAlpha="1.0"
android:interpolator="@android:anim/accelerate_interpolator"
android:duration="5000" />
</set>
Could you please tell me that I am wrong; checking in detail the LogCat does not launch anything