app/src/main/java/edu/washington/briluu/quizdroid/MenuActivity.java
// check if network is available, returns true if it is, otherwise false
check if network is available, returns true if it is, otherwise false
check if network is available returns true if it is otherwise false
public boolean isNetworkAvailable() {
        ConnectivityManager cm = (ConnectivityManager)
                getApplicationContext().getSystemService(Context.CONNECTIVITY_SERVICE);
        NetworkInfo activeNetwork = cm.getActiveNetworkInfo();
        return activeNetwork != null &&
                activeNetwork.isConnectedOrConnecting();
    }
public boolean isNetworkAvailable ( ) { ConnectivityManager cm = ( ConnectivityManager ) getApplicationContext ( ) . getSystemService ( Context . CONNECTIVITY_SERVICE ) ; NetworkInfo activeNetwork = cm . getActiveNetworkInfo ( ) ; return activeNetwork != null && activeNetwork . isConnectedOrConnecting ( ) ; }
check if network is available, returns true if it is, otherwise false
check if network is available returns true if it is otherwise false