diff options
| author | Dianne Hackborn <hackbod@google.com> | 2010-11-01 12:47:02 -0700 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-11-01 12:47:02 -0700 |
| commit | 42679cea5d8bc4b235b290b97805b86c8c7cbca5 (patch) | |
| tree | d3876e0e6f472b9cceb92f1111cfbaebed09538c /core | |
| parent | 70a2c15ecfd4e8cd8581699d5df8a219c7d5cdb1 (diff) | |
| parent | 7025d8e4b96f14a92f9bb20902732f43d1c93e7b (diff) | |
| download | frameworks_base-42679cea5d8bc4b235b290b97805b86c8c7cbca5.zip frameworks_base-42679cea5d8bc4b235b290b97805b86c8c7cbca5.tar.gz frameworks_base-42679cea5d8bc4b235b290b97805b86c8c7cbca5.tar.bz2 | |
Merge "Fix issue #3152415: Various confusions in docs about Application" into gingerbread
Diffstat (limited to 'core')
| -rw-r--r-- | core/java/android/app/Application.java | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/core/java/android/app/Application.java b/core/java/android/app/Application.java index 45ce860..b9ac848 100644 --- a/core/java/android/app/Application.java +++ b/core/java/android/app/Application.java @@ -27,6 +27,14 @@ import android.content.res.Configuration; * AndroidManifest.xml's <application> tag, which will cause that class * to be instantiated for you when the process for your application/package is * created. + * + * <p class="note">There is normally no need to subclass Application. In + * most situation, static singletons can provide the same functionality in a + * more modular way. If your singleton needs a global context (for example + * to register broadcast receivers), the function to retrieve it can be + * given a {@link android.content.Context} which internally uses + * {@link android.content.Context#getApplicationContext() Context.getApplicationContext()} + * when first constructing the singleton.</p> */ public class Application extends ContextWrapper implements ComponentCallbacks { @@ -46,12 +54,10 @@ public class Application extends ContextWrapper implements ComponentCallbacks { } /** - * Called when the application is stopping. There are no more application - * objects running and the process will exit. <em>Note: never depend on - * this method being called; in many cases an unneeded application process - * will simply be killed by the kernel without executing any application - * code.</em> - * If you override this method, be sure to call super.onTerminate(). + * This method is for use in emulated process environments. It will + * never be called on a production Android device, where processes are + * removed by simply killing them; no user code (including this callback) + * is executed when doing so. */ public void onTerminate() { } |
