Fix NPE during Activity transition using wrong Activity.

am: a3edbf6a5d

Change-Id: Ie6ca8f9f9f251eaf844f842e0f6f0ab36a975c1e
This commit is contained in:
George Mount
2016-08-18 22:32:08 +00:00
committed by android-build-merger

View File

@@ -337,11 +337,12 @@ class ActivityTransitionState {
}
public void startExitOutTransition(Activity activity, Bundle options) {
if (!activity.getWindow().hasFeature(Window.FEATURE_ACTIVITY_TRANSITIONS)) {
mEnterTransitionCoordinator = null;
if (!activity.getWindow().hasFeature(Window.FEATURE_ACTIVITY_TRANSITIONS) ||
mExitTransitionCoordinators == null) {
return;
}
ActivityOptions activityOptions = new ActivityOptions(options);
mEnterTransitionCoordinator = null;
if (activityOptions.getAnimationType() == ActivityOptions.ANIM_SCENE_TRANSITION) {
int key = activityOptions.getExitCoordinatorKey();
int index = mExitTransitionCoordinators.indexOfKey(key);