开发者

Cannot disable transition animation when back button is clicked

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.overridePendi开发者_如何学GongTransition(0, 0);


You should call overridePendingTransition(0, 0); in Activity's onPause():

 public void onPause() {
     super.onPause();
     overridePendingTransition(0, 0);
 }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜