Android:overridePendingTransition不适用于FLAG_ACTIVITY_REORDER_TO_FRONT

时间:2015-10-19 15:11:17

标签: android animation transitions

我有一个使用FLAG_ACTIVITY_REORDER_TO_FRONT启动的活动,我用它来设置应用程序中始终处于活动状态的活动。如果FLAG_ACTIVITY_REORDER_TO_FRONT被激活overridePendingTransition无效,我想这是因为活动已经打开,overridePendingTransition无法运行它。我的问题是有一些方法可以激活动画。

提前致谢。

 Intent intent = new Intent(Welcome.this, UploadsList.class);

            intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
            startActivity(intent);
            finish();

            overridePendingTransition(R.anim.down_to_top1, R.anim.down_to_top2);

更新!!!

经过长时间的研究,我找到了解决方案。

刚才我在转换XML中添加了

android:zAdjustment="top"

我用:

激活overridePendingTransition
@Override
protected void onNewIntent(Intent intent) {
    super.onNewIntent(intent);
    overridePendingTransition(R.anim.down_to_top1, R.anim.down_to_top2);
}

0 个答案:

没有答案