TaskStackBuilder transition animation

送分小仙女□ 提交于 2019-12-04 09:50:31

问题


I'm using Android L transitions passing an ActivityOptions bundle in intent. How can I reproduce the animation on the same intent with TaskStackBuilder?

This is my current working method with a single Intent:

startActivity(myIntent, ActivityOptions.makeSceneTransitionAnimation(this).toBundle());

This is my try with TaskStackBuilder:

 TaskStackBuilder builder = TaskStackBuilder.create(this);
 builder.addNextIntentWithParentStack(myIntent);
 builder.startActivities(ActivityOptions.makeSceneTransitionAnimation(this).toBundle());

But the animation creates a strange effect, not the same one of the "single-intent" version.

I also tried with:

builder.addNextIntent(myIntent);

instead of:

builder.addNextIntentWithParentStack(myIntent);

回答1:


Try to do it using:

TaskStackBuilder.create (Context context)

Return a new TaskStackBuilder for launching a fresh taskstack consisting of a series of activities. Parameters -

Context context: The context that will launch the new task stack or generate a PendingIntent.

Returns, TaskStackBuilder - a new TaskStackBuilder.



来源:https://stackoverflow.com/questions/33893175/taskstackbuilder-transition-animation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!