Back to project page LollipopShowcase.
The source code is released under:
Apache License
If you think the Android project LollipopShowcase listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.mikepenz.lollipopshowcase.util; /*from w ww . j ava 2s . c o m*/ import android.content.Context; import android.net.ConnectivityManager; import android.net.NetworkInfo; public class Network { public static boolean isAvailiable(Context ctx) { ConnectivityManager conMgr = (ConnectivityManager) ctx.getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo i = conMgr.getActiveNetworkInfo(); if (i == null) return false; if (!i.isConnected()) return false; if (!i.isAvailable()) return false; return true; } }