Issue: ActivityA starts ActivityB with shared element transitions intermittently crashes Not consistently reproducible Api levels: 23, 24 and 25
I suppose, you should not use methods from support library for that versions. Sure, I can't figure out, from your existing issue due of random stacktrace.
Since Tranlsation Scene introduced form 4.4. You can include api deprecation. Moreover, it's recommended, otherwise, why we need both types?
if (Build.VERSION.SDK_INT >= 21) {
ActivityOptions options = ActivityOptions
.makeSceneTransitionAnimation(this, logoTransition, logoTextTransition);
startActivity(this, intent, options.toBundle());
}
else {
ActivityOptionsCompat options = ActivityOptionsCompat
.makeSceneTransitionAnimation(this, logoTransition, logoTextTransition);
ActivityCompat.startActivity(this, intent, options.toBundle());
}
in my case this happen because i subscribe on click action two times, so startActivity was called twice in a row.
hope this can be helpful for some one :)
Try loading transitions in the onCreate()
method of the concerned activity like this:
getWindow().requestFeature(Window.FEATURE_CONTENT_TRANSITIONS);
Transition mTransition = //your transitions
getWindow().setSharedElementEnterTransition(mTransition);
getWindow().setSharedElementExitTransition(mTransition);