Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I can suggest two books, but I'd also like to suggest an actual empirical test that you should try. </p> <h2>To answer your original question:</h2> <p>Commonsware is a good source and Mark Murphy has a badge cred on Stack Overflow.</p> <p>The Busy Coders Guide to Android Development, from Commonsware.com</p> <p>I've had good mileage on pages 8 &amp; 9 of this book from O'Reilly. I found that in order to fully grasp the Android Life cycle I had to read these pages at least 10 times.<br> Android Application Development, ISBN 978-0596521479</p> <h2>Suggestion for empirical testing</h2> <p>of the <a href="http://developer.android.com/reference/android/app/Activity.html#ActivityLifecycle" rel="nofollow">Android activity lifecycle</a> </p> <p>Create an android Activity or sample app, and log each time one of the Android Lifecycle methods has been entered. As in this sample.</p> <p>Add these logs entries to your activity, then build it. Run it on a device or on the emulator with <code>adb logcat</code> running. Then do some experiments. See what happens when you lock the screen, press home, press 'menu', etc. This method will help you understand than just reading. You will still need to read and study the activity lifecycle, but this will help quite a bit.</p> <pre><code>public class YourActivity { private static final String LOG_TAG = "YourActivity"; @Override public void onCreate(Bundle savedInstanceState) { Log.d(LOG_TAG, "onCreate()"); super.onCreate(savedInstanceState); } @Override public void onStart() { Log.d(LOG_TAG, "onStart()"); super.onStart(); } @Override public void onStop() { Log.d(LOG_TAG, "onStop()"); super.onStop(); } @Override protected void onDestroy() { Log.d(LOG_TAG, "onDestroy()"); super.onDestroy(); } @Override protected void onPause() { Log.d(LOG_TAG, "onPause()"); super.onPause(); } @Override protected void onResume() { Log.d(LOG_TAG, "onResume()"); super.onResume(); } } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload