应用因转换而无响应

App not Responding due to transition

我应用幻灯片切换到 Activity B 到 Activity A
Activity A -> Activity B
当我返回 Activity A(通过按返回按钮)
Activity B -> Activity A
然后再到 Activity B
Activity A -> Activity B
应用程序没有响应。可能的原因及其解决方法是什么? 这是代码:-
Activity答:-

package com.tester;

import android.annotation.SuppressLint;
import android.app.ActivityOptions;
import android.content.Intent;
import android.graphics.Typeface;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.transition.Scene;
import android.transition.Slide;
import android.transition.TransitionManager;
import android.view.Gravity;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

public class Anima extends AppCompatActivity {
    ViewGroup root_scene;
    Bundle bundle;
    @SuppressLint("NewApi")
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.anima);
        root_scene = (ViewGroup) findViewById(R.id.root_scene);
        ImageView iv = (ImageView) findViewById(R.id.info_image);
        /*final Slide slide = new Slide(Gravity.TOP);
        slide.addTarget(R.id.test_image);
        getWindow().setEnterTransition(slide);
        */
        bundle = ActivityOptions.makeSceneTransitionAnimation(this).toBundle();
        TextView tv = (TextView) findViewById(R.id.head);
        Typeface type = Typeface.createFromAsset(getAssets(), "roboto.ttf"); 
        tv.setTypeface(type);
        tv.setText("Armed robbers used Pokémon Go to target victims in Missouri");
        iv.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View arg0) {
                // TODO Auto-generated method stub
                Intent intent = new Intent(Anima.this,Second.class);
                startActivity(intent,bundle);
            }
        });

    }
}

Activity乙:-

import android.annotation.SuppressLint;
import android.app.ActivityOptions;
import android.content.Intent;
import android.graphics.Typeface;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.transition.Slide;
import android.view.Gravity;
import android.widget.TextView;

public class Second extends AppCompatActivity{
    Bundle bundle;
    @SuppressLint("NewApi")
    @Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.another_scene);
      bundle = ActivityOptions.makeSceneTransitionAnimation(this).toBundle();
    TextView tv2 = (TextView) findViewById(R.id.details);
    Typeface type = Typeface.createFromAsset(getAssets(), "robot_light.ttf"); 
    tv2.setTypeface(type);
    tv2.setText("As popular as Pokémon Go has become, that it sends players out into the real world to find Pokémon is creating new, unexpected problems. The O'Fallon, Missouri Police Department reported on Facebook today that armed robbers have used the app to lure victims in and rob them at gunpoint.\nThe police received reports about the robberies and were able to apprehend four suspects in the area. Apparently, the thieves used the app to set up a beacon at a Pokéstop within the game. Using this method, Sergeant Bill Stringer of the OPD told Motherboard that the culprits were able to rob 11 players, all between the ages of 16 and 18, in the St. Louis and St. Charles counties of Missouri.");
    Slide slide =   new Slide(Gravity.BOTTOM);
    slide.addTarget(tv2);
    getWindow().setEnterTransition(slide);
}

}

bundle 初始化移动到 onClick() 方法中的 Activity Anima 中。尝试

iv.setOnClickListener(new OnClickListener() {
    @Override
    public void onClick(View arg0) {
        // TODO Auto-generated method stub
        bundle = ActivityOptions.makeSceneTransitionAnimation(Anima.this).toBundle();
        Intent intent = new Intent(Anima.this,Second.class);
        startActivity(intent,bundle);
    }
});