diff options
author | David Friedman <dmail@google.com> | 2013-09-27 17:25:16 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-09-27 17:25:16 +0000 |
commit | 0b1cfc1fb64a1b24f107abf106eb839287f65cfb (patch) | |
tree | 62e5dcdce39548208e33384434d08a79a3fd255c | |
parent | 8c38ea39203016dde95bc5dd68f27f6f45096784 (diff) | |
parent | 8ca6a095a358ec49695b00c239273bf6f3b1a2e6 (diff) | |
download | frameworks_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
-rw-r--r-- | docs/html/training/monitoring-device-state/connectivity-monitoring.jd | 3 |
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> |