Completely baffled about OnCreate and OnResume

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Completely baffled about OnCreate and OnResume

Postby chefgon » Fri Nov 21, 2008 9:21 pm

I've been searching for a really simple, straightforward example of how to deal with a process getting destroyed (like when flipping the keyboard open or leaving the app open in the background for too long). I've seen lots of vague references to OnCreate and OnResume and I feel like I have a general grasp of what happens, but I can't find any examples that implement it in an understandable way.

Does anybody have or know of a code example specifically for illustrating this feature? I'm not sure if I have to specifically save data on the screen and reload it in some kind of manual way, or if there are functions built into the API that memorize and reload that data automatically... I'm just totally confused.

I'd like to see an example of functioning code that does nothing more than properly implement this, with the functions that are called during the destroy and the ones that are called during the recreate. Does anybody have something that might help me wrap my brain around this concept? Even if somebody could just point me to the methods involved with this process in one of the google supplied samples, that would probably be enough.
chefgon
Junior Developer
Junior Developer
 
Posts: 17
Joined: Fri Oct 31, 2008 8:26 pm

Top

Postby richard.puckett » Fri Nov 21, 2008 10:48 pm

AndroidGuys recently did a good three-part write up on this kind of thing.

http://androidguys.com/?p=2084
Image
richard.puckett
Junior Developer
Junior Developer
 
Posts: 13
Joined: Thu Dec 27, 2007 2:37 am
Location: Seattle, WA

Postby chefgon » Sat Nov 29, 2008 1:26 am

That gives a pretty good rundown of what the methods are and when they are called, but he never attempts to write to or use the savedInstanceState bundle, so it doesn't really tell me how to use it in a meaningful way.
chefgon
Junior Developer
Junior Developer
 
Posts: 17
Joined: Fri Oct 31, 2008 8:26 pm

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 5 guests