Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.overridePendingTransition(0, 0);
like image 362
davidlee Avatar asked Aug 05 '11 15:08

davidlee


1 Answers

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

 public void onPause() {
     super.onPause();
     overridePendingTransition(0, 0);
 }
like image 176
inazaruk Avatar answered Sep 23 '22 04:09

inazaruk