I'm trying to use the new API to switch activity only to lollipop (I use the compact version of tho), so I am implementing an animation from activity A to action B in Activity A:
getWindow().setReenterTransition(null); getWindow().setExitTransition(null); getWindow().setAllowEnterTransitionOverlap(false); getWindow().setAllowReturnTransitionOverlap(false);
because Iām not interested in entering or leaving this action, the only animations I want to see are in general view with activity B.
To start Activity B:
ActivityCompat.startActivity(this, intent, ActivityOptionsCompat.makeSceneTransitionAnimation(this, fabButton, getString(R.string.transition_fab)).toBundle());
And setting up Activity B:
getWindow().setEnterTransition(new EmptyTransition()); getWindow().setReturnTransition(null); getWindow().setAllowEnterTransitionOverlap(false); getWindow().setAllowReturnTransitionOverlap(false); getWindow().getEnterTransition().addListener(listener).
Again, I am not interested in the transition transition with a return, because the content is hidden until the transition method to the transition mode "onTransitionEnd" is called, so my transition is all based on a common element that moves / grows from Activity A to action B , and when this transition is complete, I bring the content.
Everything works fine, but on not very powerful devices (like all non-Nexus), from time to time, activity A silently drops with:
java.lang.RuntimeException: Performing stop of activity that is not resumed: {com.transferwise.android.debug/com.transferwise.android.activity.LoggedInMainActivity}
And the transition of the common element occurs, but then the listener is not called (and not the TransitionStart event), so the content is not injected. The application does not crash, the user can still click and try again, but this is not a very good UX.
It is difficult to verify this because it happens every 10/20 times and only on certain specific devices (this happens more on the Sony Xperia Z3 CD).
also:
Danieles-MacBook-Pro-2:~ danielebottillo$ adb shell dumpsys activity p | grep com.package.main.debug *APP* UID 10349 ProcessRecord{3b27508d 18371:com.package.main.debug/u0a349} dir=/data/app/com.package.main.debug-1/base.apk publicDir=/data/app/com.package.main.debug-1/base.apk data=/data/data/com.package.main.debug packageList={com.package.main.debug} - ActivityRecord{2f07bdf8 u0 com.package.main.debug/com.package.main.activity.ActivityA t1196} - ActivityRecord{1e871eb3 u0 com.package.main.debug/com.package.main.activity.ActivityB t1196} - 28ea3e28/com.android.providers.settings/.SettingsProvider->18371:com.package.main.debug/u0a349 s1/1 u0/0 +27m9s645ms - ReceiverList{40f2178 18371 com.package.main.debug/10349/u0 remote:39e102db} - ReceiverList{2e7456a6 18371 com.package.main.debug/10349/u0 remote:dde3801} - ReceiverList{39e2f1b7 18371 com.package.main.debug/10349/u0 remote:362300b6} - ReceiverList{3afa7bd5 18371 com.package.main.debug/10349/u0 remote:33e4088c} Proc