取消SingleInstance上的所有动画 [英] Cancel ALL Animation on SingleInstance

查看:744
本文介绍了取消SingleInstance上的所有动画的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am wondering if its at all possible to cancel ALL animation when starting an singleInstance activity, i am already using

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

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

用于调用finish和

for when finish is called and

    intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);

激活它...但是仍然存在黑屏(短装一个)。

to activate it... but theres still a black screen ( short loading one). trying creating a costume Theme and didnt cancel it.

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

i kinda gave up hope... I know fragments will solve it. is there any way without?

推荐答案

您是否曾尝试在调用 overridePendingTransition > startActivity(...)

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

您也可以通过主题禁用动画

You can also disable animations via themes

开发人员应创建样式,

<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>

您还可以指定一种样式来指定自定义的进入和退出动画,因此可以使其做些什么您也喜欢
http://developer.android.com /reference/android/R.attr.html#windowEnterAnimation

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

这篇关于取消SingleInstance上的所有动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆