tags:

views:

76

answers:

1

The default animation when the Back button is pressed is a slide from left to right. I'd like to replace that with a custom animation. I'm currently thinking that some combination of onBackPressed() and overridePendingTransition will do the trick, but I haven't been able to get it working.

A: 

Figured it out. I wasn't finshing the current activity. The following code does the trick.

@Override
public void onBackPressed() {
  [This Activity].this.finish();
  overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
}
dfetter88