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.
views:
76answers:
1
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
2010-07-20 20:17:31