Transitional animation TaskStackBuilder

I use Android L transitions by passing the ActivityOptions package in intent. How can I play an animation with the same intent using TaskStackBuilder ?

This is my current working method with one Intent :

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

This is my attempt using TaskStackBuilder :

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

But the animation creates a strange effect, and not the same as in the single-purpose version.

I also tried:

 builder.addNextIntent(myIntent); 

instead:

 builder.addNextIntentWithParentStack(myIntent); 
+47
android android-intent animation taskstackbuilder
Nov 24 '15 at 12:00
source share
1 answer

Try to do this using:

 TaskStackBuilder.create (Context context) 

Return the new TaskStackBuilder to launch a new task consisting of a series of actions. Options -

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

Returns, TaskStackBuilder is the new TaskStackBuilder.

+1
Nov 13 '16 at 3:33
source share



All Articles