Android的 - 如何停止活动变化的动画 [英] Android - How to stop animation between activity changes

查看:213
本文介绍了Android的 - 如何停止活动变化的动画的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有多个不同的活动在我的应用程序和活动之间切换时,我不希望任何过渡动画。下面是我是如何活动的变化:

I have multiple different Activity in my app and I don't want any transition animation when changing between Activities. Below is the how I'm changing between Activities:

Intent i = new Intent(FirstActivity.this, SecondActivity.class);
            i.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
            i.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
            startActivity(i);

这个伟大的工程,我第一次开始新的活动。没有动画,但是当我回到一个活动,已经开始看起来像Intent.FLAG_ACTIVITY_NO_ANIMATION被忽略,默认的动画发生。

This works great the first time I start a new Activity. There is no animation, but when I go back to an Activity that is already started it seems like the "Intent.FLAG_ACTIVITY_NO_ANIMATION" is ignored and the default animation happens.

我似乎无法弄清楚为什么会这样。

I can't seem to figure out why this is happening.

推荐答案

您是否尝试过<一个href="http://developer.android.com/reference/android/app/Activity.html#overridePendingTransition%28int,%20int%29"><$c$c>overridePendingTransition()?

Have you tried overridePendingTransition()?

这篇关于Android的 - 如何停止活动变化的动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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