2019-04-28 18:54:22 +02:00
|
|
|
package com.darkweb.genesissearchengine;
|
2019-03-27 19:07:03 +01:00
|
|
|
|
|
|
|
import android.content.Context;
|
|
|
|
import android.net.ConnectivityManager;
|
|
|
|
import android.net.NetworkInfo;
|
|
|
|
|
|
|
|
public class helperMethod
|
|
|
|
{
|
|
|
|
public static boolean isNetworkAvailable(Context application_context)
|
|
|
|
{
|
|
|
|
ConnectivityManager cm = (ConnectivityManager) application_context.getSystemService(Context.CONNECTIVITY_SERVICE);
|
|
|
|
NetworkInfo networkInfo = cm.getActiveNetworkInfo();
|
|
|
|
if (networkInfo != null && networkInfo.isConnected())
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|