summaryrefslogtreecommitdiffstats
path: root/core/java/android/app/Application.java
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2010-11-01 09:49:37 -0700
committerDianne Hackborn <hackbod@google.com>2010-11-01 09:49:37 -0700
commit7025d8e4b96f14a92f9bb20902732f43d1c93e7b (patch)
tree2efe2dba3ca25948605465b5811ad8cdb9c24a57 /core/java/android/app/Application.java
parent38fd394815a992c8874f73389e8ca849782e5fcd (diff)
downloadframeworks_base-7025d8e4b96f14a92f9bb20902732f43d1c93e7b.zip
frameworks_base-7025d8e4b96f14a92f9bb20902732f43d1c93e7b.tar.gz
frameworks_base-7025d8e4b96f14a92f9bb20902732f43d1c93e7b.tar.bz2
Fix issue #3152415: Various confusions in docs about Application
Change-Id: Ie1b480ed7a47a3eb6ffff76bef0dcd7b2b845e83
Diffstat (limited to 'core/java/android/app/Application.java')
-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() {
}