Deal with not working animations when activity is SingleInstance

android, shared-element-transition

Solution

Please refer this link.

SingleInstance is same as singleTask, except that the system doesn't launch any other activities into the task holding the instance. The activity is always the single and only member of its task; any activities started by this one open in a separate task.

Go ahead and use "singleTask" as launchMode your app will work fine.

Problem

I am developing an android app and I have used `android:launchMode="singleInstance"` for it,but as I activated it none of `TransitionAnimation` works and it makes my activity like this In fact my main activity is singleinstane and when I want to lunch a new activity the new one does not work and ui breaks. well what can I do with it?Is there any way to have animations while singleinstace is activated? this is my code which lunches activity ``` Intent intent = new Intent(context, ActivityMall.class); Bundle b = new Bundle(); b.putParcelable("EXTRA_MALL",((Mall)v.getTag(R.id.TAG_MALL_ID))); b.putParcelable("EXTRA_Company",null); intent.putExtras(b); ActivityOptionsCompat options = ActivityOptionsCompat.makeSceneTransitionAnimation((Activity) context, (View)v.getTag(R.id.TAG_MALL_COVER2), // Starting view "profile1" // The String ); ActivityCompat.startActivity((Activity) context, intent, options.toBundle()); ``` I read somewhere that I should set `android:launchMode="singleTask"` but I have no idea about its difference with singleinstance.. thanks very much

Original source

Related problems