Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8ca6a095 authored by David Friedman's avatar David Friedman
Browse files

Docs: In the section "Determine if You Have an Internet Connection," I added...

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

Change-Id: I95344c2200cad5efb6457a9cb8fcd0e87298dcda
parent a8f519ff
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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>