Here you can find the source of isOpenNetwork(Context context)
public static boolean isOpenNetwork(Context context)
//package com.java2s; import android.content.Context; import android.net.ConnectivityManager; public class Main { public static boolean isOpenNetwork(Context context) { ConnectivityManager connManager = (ConnectivityManager) context .getSystemService(Context.CONNECTIVITY_SERVICE); if (connManager.getActiveNetworkInfo() != null) { return connManager.getActiveNetworkInfo().isAvailable(); }/* ww w . ja v a 2 s . c o m*/ return false; } }