summaryrefslogtreecommitdiffstats
path: root/docs/html/training
diff options
context:
space:
mode:
authorDavid Friedman <dmail@google.com>2013-09-27 17:25:16 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-09-27 17:25:16 +0000
commit0b1cfc1fb64a1b24f107abf106eb839287f65cfb (patch)
tree62e5dcdce39548208e33384434d08a79a3fd255c /docs/html/training
parent8c38ea39203016dde95bc5dd68f27f6f45096784 (diff)
parent8ca6a095a358ec49695b00c239273bf6f3b1a2e6 (diff)
downloadframeworks_base-0b1cfc1fb64a1b24f107abf106eb839287f65cfb.zip
frameworks_base-0b1cfc1fb64a1b24f107abf106eb839287f65cfb.tar.gz
frameworks_base-0b1cfc1fb64a1b24f107abf106eb839287f65cfb.tar.bz2
Merge "Docs: In the section "Determine if You Have an Internet Connection," I added to the code snippet so that it also checks whether activeNetwork is null. Bug: 10797360" into jb-mr2-docs
Diffstat (limited to 'docs/html/training')
-rw-r--r--docs/html/training/monitoring-device-state/connectivity-monitoring.jd3
1 files changed, 2 insertions, 1 deletions
diff --git a/docs/html/training/monitoring-device-state/connectivity-monitoring.jd b/docs/html/training/monitoring-device-state/connectivity-monitoring.jd
index 11a05e1..fb5096d 100644
--- a/docs/html/training/monitoring-device-state/connectivity-monitoring.jd
+++ b/docs/html/training/monitoring-device-state/connectivity-monitoring.jd
@@ -49,7 +49,8 @@ to query the active network and determine if it has Internet connectivity.</p>
(ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo activeNetwork = cm.getActiveNetworkInfo();
-boolean isConnected = activeNetwork.isConnectedOrConnecting();</pre>
+boolean isConnected = activeNetwork != null &&
+ activeNetwork.isConnectedOrConnecting();</pre>
<h2 id="DetermineType">Determine the Type of your Internet Connection</h2>