单击后退按钮时无法禁用过渡动画
当我单击后退按钮返回到上一个活动时,即使我添加了 overridePendingTransition,过渡幻灯片仍然会发生。我的代码有什么问题吗?
我想禁用活动之间的所有转换。转到新活动时没有过渡动画,但按下后退按钮时滑出。
Activity act;
Intent intent = new Intent(act, newactivity.class);
intent.setFlags(65536);
act.startActivity(intent);
act.overridePendingTransition(0, 0);
When I click the back button to go back to previous activity, the transition slide still occur even though I have added overridePendingTransition. What is wrong with my code?
I want to disable all transition between the activities. There is no animation on transition when going to new activity but slide out when back button is pressed.
Activity act;
Intent intent = new Intent(act, newactivity.class);
intent.setFlags(65536);
act.startActivity(intent);
act.overridePendingTransition(0, 0);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该在 Activity 的
onPause()
中调用overridePendingTransition(0, 0);
:You should call
overridePendingTransition(0, 0);
in Activity'sonPause()
: