4

我想知道在启动 singleInstance 活动时是否可以取消所有动画,我已经在使用

@Override
public void onStop() {
    super.onStop();
    overridePendingTransition(0, 0);
}

@Override
public void onResume() {
    super.onResume();
    overridePendingTransition(0, 0);
}

当调用完成时

    intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);

激活它......但仍然是一个黑屏(短加载一个)。尝试创建服装主题并没有取消它。

我有点放弃了希望......我知道碎片会解决它。有没有办法没有?

4

1 回答 1

2

Have you tried calling overridePendingTransition after calling startActivity(...)

You can also disable animations via themes

Developer should create a style,

<style name="noAnimTheme" parent="android:Theme">
  <item name="android:windowAnimationStyle">@null</item>
</style>

then in manifest set it as theme for activity or whole application.

<activity android:name=".ui.ArticlesActivity" android:theme="@style/noAnimTheme">
</activity>

You can also specify a style to specify custom entry and exit animations, so you can make it do what you like as well http://developer.android.com/reference/android/R.attr.html#windowEnterAnimation

于 2013-10-08T23:09:56.420 回答