Android-在动画期间保持活动

Android-在动画期间保持活动,android,animation,android-activity,Android,Animation,Android Activity,我想在Android中创建一个从一个活动到下一个活动的动画过渡。但在动画过程中,黑色背景会短暂变暗,然后显示我要显示的下一个活动的动画 我希望保持第一个活动的完整性,以便第二个活动将设置动画并与第一个活动重叠。我如何实现此行为 以下是我当前的两个动画xml文件,它们并不是我想要实现的: hold.xml 提前谢谢大家,, Pat从活动A转换到活动B的默认动画取决于设备。如果屏幕短时间变黑,那是因为您的设备以这种方式实现它。。。但是,您可以覆盖应用程序主题用于将自定义动画应用于活动之间转换的动画。

我想在Android中创建一个从一个活动到下一个活动的动画过渡。但在动画过程中,黑色背景会短暂变暗,然后显示我要显示的下一个活动的动画

我希望保持第一个活动的完整性,以便第二个活动将设置动画并与第一个活动重叠。我如何实现此行为

以下是我当前的两个动画xml文件,它们并不是我想要实现的:

hold.xml

提前谢谢大家,,
Pat

从活动A转换到活动B的默认动画取决于设备。如果屏幕短时间变黑,那是因为您的设备以这种方式实现它。。。但是,您可以覆盖应用程序主题用于将自定义动画应用于活动之间转换的动画。

输入活动动画。

startActivity(new Intent(this, AnimaitonActivity.class));
overridePendingTransition(R.anim.pull_up_from_bottom, R.anim.hold);
finish();
overridePendingTransition(R.anim.hold, R.anim.push_out_to_bottom);
退出活动动画

startActivity(new Intent(this, AnimaitonActivity.class));
overridePendingTransition(R.anim.pull_up_from_bottom, R.anim.hold);
finish();
overridePendingTransition(R.anim.hold, R.anim.push_out_to_bottom);
从\u bottom.xml向上拉\u

<translate xmlns:android="http://schemas.android.com/apk/res/android"
    android:duration="1000"
    android:fromYDelta="100%"
    android:toYDelta="0%" />
<translate xmlns:android="http://schemas.android.com/apk/res/android"
    android:duration="1000"
    android:fromYDelta="0%"
    android:toYDelta="100%" />
<set xmlns:android="http://schemas.android.com/apk/res/android"
    android:shareInterpolator="false" >
    <translate
        android:duration="2000"
        android:zAdjustment="bottom" />
</set>

将\u推出到\u bottom.xml

<translate xmlns:android="http://schemas.android.com/apk/res/android"
    android:duration="1000"
    android:fromYDelta="100%"
    android:toYDelta="0%" />
<translate xmlns:android="http://schemas.android.com/apk/res/android"
    android:duration="1000"
    android:fromYDelta="0%"
    android:toYDelta="100%" />
<set xmlns:android="http://schemas.android.com/apk/res/android"
    android:shareInterpolator="false" >
    <translate
        android:duration="2000"
        android:zAdjustment="bottom" />
</set>

hold.xml

<translate xmlns:android="http://schemas.android.com/apk/res/android"
    android:duration="1000"
    android:fromYDelta="100%"
    android:toYDelta="0%" />
<translate xmlns:android="http://schemas.android.com/apk/res/android"
    android:duration="1000"
    android:fromYDelta="0%"
    android:toYDelta="100%" />
<set xmlns:android="http://schemas.android.com/apk/res/android"
    android:shareInterpolator="false" >
    <translate
        android:duration="2000"
        android:zAdjustment="bottom" />
</set>

请提供任何代码或示例,说明如何覆盖主题转换动画(而不是活动)