1


I have a back button that will work exactly like that.
I know using back button is not a good android practice since android device have one. But my situation badly need it.
I cannot finish my activity and its tough to Keep track of the activity stack.

asked Apr 13, 2011 at 15:47

3 Answers 3

1

Since you know that overriding BACK button function is not a good practice, just follow it. Tracking activity stack and promising the BACK behavior can be solved by properly setting the launch mode of each Activity. (please see: Launch Mode in Android Official Site)

If you insist to do something like pressing the BACK button, it's super.onBackPressed().

answered Apr 13, 2011 at 16:33
Sign up to request clarification or add additional context in comments.

Comments

0

its better for you to user super.onBackPressed()
Refer Go back to previous activity

answered Apr 13, 2011 at 15:50

Comments

0

I wonder why you wouldn't want to finish your activity. Could you move whatever it is in your activity you don't want to destroy into another object?

BTW: the activity will also be destroyed and re created if the screen is rotated.

answered Apr 13, 2011 at 18:13

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.