Process kill

Common bugs/problems with the Android SDK the Emulator and the ADT-Plugin.

Process kill

Postby designerrr » Sun Jul 17, 2011 2:42 pm

Hi, im new to android developing and i am reading official dev guide.

Here http://developer.android.com/guide/topics/fundamentals/activities.html is table, wich describe what activity lifecycle callback can be followed by another.
I quote onStart() callback:
Called just before the activity becomes visible to the user.
Followed by onResume() if the activity comes to the foreground, or onStop() if it becomes hidden.

My first question is - in what situation is after onStart() called onStop()? It is possible something like start activity in background, so next after onStart is onStop?
And second question is a little mistake or what.
Below that table is:
The column labeled "Killable after?" indicates whether or not the system can kill the process hosting the activity at any time after the method returns, without executing another line of the activity's code. Three methods are marked "yes": (onPause(), onStop(), and onDestroy()). Because onPause() is the first of the three, once the activity is created, onPause() is the last method that's guaranteed to be called before the process can be killed—if the system must recover memory in an emergency, then onStop() and onDestroy() might not be called. Therefore, you should use onPause() to write crucial persistent data (such as user edits) to storage.

But if onStop() can be called immediately after onStart() ( see what i wrote above) and onStop() is marked as "killable after", then code in onPause() is not executed, right?
THX all for your time.
designerrr
Once Poster
Once Poster
 
Posts: 1
Joined: Sun Jul 17, 2011 2:17 pm

Top

Return to SDK/ADT/Emulator Problems

Who is online

Users browsing this forum: No registered users and 3 guests