Android back button event

You must Login before you can answer or comment on any questions.

Hi, I've created a view on my screen that shows different options. Once I choose an option it animates to a different view. what I want to do now is when an android user click the "back" button to animate back to the options screen (I've seen it on other applications) - how can I achieve that?

Thanks

1 Answer

On any Android window object you can listen for the android:back back event to know when the back button on the device has been clicked. Within this event, you can handle the transitioning of windows just as you would normally.

— answered 2 years ago by Anthony Decena
answer permalink
1 Comment
  • Hi, thanks for the answer.

    I'll try to better explain what I'm doing... I have a registration wizard when my app starts. The registration has a few steps and each step is contained within a different view. each view is contained out of the screen width boundaries. each "continue" button animates (slide like) to the next step.

    What happens is that on Android there's the back button, that once clicked closes the registration window (I don't care that the registration window opens in a new context) - but what I want to do is that each "back" goes back a step. any ideas?

    — commented 2 years ago by Ophir 'Shlomi' Oren

Your Answer

Think you can help? Login to answer this question!