0

I'm trying to start a new activity that has this style:

<style name="SecondActivityStyle" parent="SomeParent">
        <item name="android:windowActivityTransitions" tools:targetApi="lollipop">true</item>
        <item name="android:windowEnterTransition" tools:targetApi="lollipop">@transition/explode</item>
        <item name="android:windowExitTransition" tools:targetApi="lollipop">@transition/explode</item>
</style>

But the thing is, I was already sending a bundle with some Strings so I'm trying to create the bundle this way now:

if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
    extras = ActivityOptions.makeSceneTransitionAnimation(this).toBundle();
}

extras.putSerializable("user", user);
extras.putString("feedName", feedName);

final Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(deepLink));
intent.putExtras(extras);
startActivityForResult(intent, 1);

But I'm always getting the default transition instead of the "explode" one. Could it be a problem with the extras in the bundle?

Jose Gonzalez
  • 1,491
  • 3
  • 25
  • 51

1 Answers1

1

Definitely, there is no problem with bundle. See the below answer to apply transition to activity programtically How to achieve right to left animation to start the activity

Ashok Kumar
  • 1,226
  • 1
  • 10
  • 14