Launch an Android Application programatically without an Animation/Transition

27 views Asked by At

I have 2 applications and I want to be able to launch application B from application A with no animation, basically as if the next frame is the launch activity of application B. It is basically the same behavior as if you would remove animations from your phone settings. (Accessibility > Color and motion > remove animations)

screenshot

So far I have tried :

//in my nav graph
    app:exitAnim="@null"
    app:popEnterAnim="@null"
    app:popExitAnim="@null"
    app:enterAnim="@null"

intent?.apply {
            component = componentName
            action = "android.intent.action.MAIN"
            addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION)
            addCategory("android.intent.category.LAUNCHER")
        }

val options = ActivityOptions.makeBasic().toBundle()
 if (intent?.resolveActivity(requireActivity().packageManager) != null) {
            requireActivity().window.setWindowAnimations(0)
            startActivity(intent,options)
        }
//also tried
val options = ActivityOptions.makeCustomAnimation(requireContext(), 0, 0).toBundle()

window.setWindowAnimations(0)

overridePendingTransition(0, 0)
window.setEnterTransition(null);
window.setExitTransition(null)

<item name="android:windowAnimationStyle">@null</item>
<item name="android:windowActivityTransitions">false</item>
<item name="android:windowShowAnimation">@null</item>
<item name="android:windowAnimationStyle">@null</item>

How does Android manage animations between apps ? Is it the same way it manages Activity/Fragment animations/transitions within the same app ? Is it even possible to achieve what I am trying to do?

0

There are 0 answers