块中的默认动画startActivity [英] Block the default animation for startActivity

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

问题描述


我开始了这样一个活动


Me started an activity like this

Intent mainIntent = new Intent(v.getContext(), Second.class);
startActivity(mainIntent);
overridePendingTransition(android.R.anim.slide_out_right,
                        android.R.anim.slide_in_left);

我已经设置overridePendingTrasition动画。
你可以看到我已经设置动画的 oposite正常的机器人startactivity动画。 所以,现在这两动画得到倒塌对方。
 我要阻止默认的动画(左>右)的同时,我们使用开​​始活动
谢谢

I have set overridePendingTrasition for animation.
You can see i have set animation the oposite to the normal android startactivity animation. So now this two animation get collapsed each other.
I want block the default animation (left->right) for while we use start activity
Thank you

推荐答案

您可以prevent默认的动画设置标志 FLAG_ACTIVITY_NO_ANIMATION
像这样

You can prevent the default animation by setting flag FLAG_ACTIVITY_NO_ANIMATION
like this

mainIntent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);

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

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