Android back button does not restart activity?

Posted by Chris on Stack Overflow See other posts from Stack Overflow or by Chris
Published on 2010-05-08T05:12:22Z Indexed on 2010/05/08 5:18 UTC
Read the original article Hit count: 382

Filed under:
|
|
|

My app intiates an activity. On the click of a button, the app opens up the browser with a webpage. When I hit the back button, it comes back to my initial activity screen, but does not resume or restart the activity.

When I put all the layout code and activity code in onResume instead of onCreate, the activity gets restarted.

My question is whether this is the right way to go about it? Can I use onResume to draw my layout and initiate the activity, or is this poor design? When the browser fires up, does the initial activity forget its layout?

Please let me know what you suggest.

Thanks Chris

© Stack Overflow or respective owner

Related posts about android

Related posts about activity