Android Studio 在Android Activity转换期间使用共享元素时屏幕 Flink 问题

jum4pzuy  于 12个月前  发布在  Android
关注(0)|答案(1)|浏览(117)

在Android活动转换期间,当从启动画面到登录页面时,会出现屏幕 Flink ,但奇怪的是,从登录到注册页面时不会出现:
x1c 0d1x的数据
有没有办法解决这个问题?
我已经看到了其他几种解决方案,例如:

下面是我的启动画面活动活动开关和动画的Java代码:

// on below line we are calling handler to run a task
        // for specific time interval
        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                Intent intent = new Intent(SplashScreen.this, signIn.class);
               // intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);

                // Get the shared element (the View) that will be transitioned between activities
                View sharedElement = findViewById(R.id.logoView);

                // Create the transition animation options
                ActivityOptions options = ActivityOptions.makeSceneTransitionAnimation(SplashScreen.this,
                        Pair.create(sharedElement,"shared_logo_transition"));

                // Start the new activity with the transition animation
                startActivity(intent, options.toBundle());

                finish();
                //overridePendingTransition(0, 0);

            }
        }, 1000);

字符串

khbbv19g

khbbv19g1#

public class SplashScreen extends AppCompatActivity {

    public static Activity activity;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        activity = this;

    }
}


public class signIn extends AppCompatActivity {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        if (SplashScreen.activity != null) {
            finish();
        }

    }

}

字符串

相关问题