public static boolean CheckNetwork(Context mContext)
{
ConnectivityManager connectivity = (ConnectivityManager) mContext
.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo netinfo = connectivity.getActiveNetworkInfo();
if (netinfo != null && netinfo.isConnected() == true) {
return true;
} else {
return false;
}
}
Press control + shift + O for importing required library
{
ConnectivityManager connectivity = (ConnectivityManager) mContext
.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo netinfo = connectivity.getActiveNetworkInfo();
if (netinfo != null && netinfo.isConnected() == true) {
return true;
} else {
return false;
}
}
Press control + shift + O for importing required library
No comments:
Post a Comment