summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2010-11-01 12:52:36 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-11-01 12:52:36 -0700
commit4f405ecee998e704023fcd6b1f67aae4f0b5979c (patch)
tree2f736ebe045c2cda2e1d312722d933507d6d9529 /core
parent4f50e8863f921ad2029d8d9450a31a143c151fa0 (diff)
parentce0f9e4e4f38ab2a674f3ec22c1749eddbf765ba (diff)
downloadframeworks_base-4f405ecee998e704023fcd6b1f67aae4f0b5979c.zip
frameworks_base-4f405ecee998e704023fcd6b1f67aae4f0b5979c.tar.gz
frameworks_base-4f405ecee998e704023fcd6b1f67aae4f0b5979c.tar.bz2
am ce0f9e4e: am 42679cea: Merge "Fix issue #3152415: Various confusions in docs about Application" into gingerbread
* commit 'ce0f9e4e4f38ab2a674f3ec22c1749eddbf765ba': Fix issue #3152415: Various confusions in docs about Application
Diffstat (limited to 'core')
-rw-r--r--core/java/android/app/Application.java18
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 &lt;application&gt; 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() {
}