Check connection using ConnectivityManager

suggest change
public static boolean isConnectedNetwork (Context context) {

    ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
    return cm.getActiveNetworkInfo () != null && cm.getActiveNetworkInfo ().isConnectedOrConnecting ();

}

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents