summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Brad Fitzpatrick <bradfitz@android.com> 2010-10-12 08:23:40 -0700
committer Android Git Automerger <android-git-automerger@android.com> 2010-10-12 08:23:40 -0700
commit4711d21a55d9ff6f234d3b06ff2d07dca19238fc (patch)
treed277a64193bd16b546245f10a3ea8f3c25a4f380
parent4b255a23041225103a6870e77a236f78c2816eda (diff)
parent9facd2d0847691ae46108713d6a7dc9f51a62135 (diff)
am 9facd2d0: Merge "StrictMode: link to designing for responsiveness ANR docs" into gingerbread
Merge commit '9facd2d0847691ae46108713d6a7dc9f51a62135' into gingerbread-plus-aosp * commit '9facd2d0847691ae46108713d6a7dc9f51a62135': StrictMode: link to designing for responsiveness ANR docs
-rw-r--r--core/java/android/os/StrictMode.java5
-rw-r--r--docs/html/guide/practices/design/responsiveness.jd4
2 files changed, 8 insertions, 1 deletions
diff --git a/core/java/android/os/StrictMode.java b/core/java/android/os/StrictMode.java
index c185007f103e..de5b7b9c5f89 100644
--- a/core/java/android/os/StrictMode.java
+++ b/core/java/android/os/StrictMode.java
@@ -38,7 +38,10 @@ import java.util.HashMap;
* network access on the application's main thread, where UI
* operations are received and animations take place. Keeping disk
* and network operations off the main thread makes for much smoother,
- * more responsive applications.
+ * more responsive applications. By keeping your application's main thread
+ * responsive, you also prevent
+ * <a href="{@docRoot}guide/practices/design/responsiveness.html">ANR dialogs</a>
+ * from being shown to users.
*
* <p class="note">Note that even though an Android device's disk is
* often on flash memory, many devices run a filesystem on top of that
diff --git a/docs/html/guide/practices/design/responsiveness.jd b/docs/html/guide/practices/design/responsiveness.jd
index b811d1b911be..a00e3aa65114 100644
--- a/docs/html/guide/practices/design/responsiveness.jd
+++ b/docs/html/guide/practices/design/responsiveness.jd
@@ -99,6 +99,10 @@ responsive to input and thus avoid ANR dialogs caused by the 5 second input
event timeout. These same practices should be followed for any other threads
that display UI, as they are also subject to the same timeouts.</p>
+<p>You can use {@link android.os.StrictMode} to help find potentially
+long running operations such as network or database operations that
+you might accidentally be doing your main thread.</p>
+
<p>The specific constraint on IntentReceiver execution time emphasizes what
they were meant to do: small, discrete amounts of work in the background such
as saving a setting or registering a Notification. So as with other methods