import android.app.Activity;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
public class Inspection {
static public boolean isConnected() {
ConnectivityManager connMgr = (ConnectivityManager) getSystemService(Activity.CONNECTIVITY_SERVICE);
NetworkInfo networkInfo = connMgr.getActiveNetworkInfo();
if (networkInfo != null && networkInfo.isConnected())
return true;
else
return false;
}
}
Error13, 61) error: cannot find symbol method getSystemService(String)
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
public class Inspection {
static public boolean isConnected() {
ConnectivityManager connMgr = (ConnectivityManager) getSystemService(Activity.CONNECTIVITY_SERVICE);
NetworkInfo networkInfo = connMgr.getActiveNetworkInfo();
if (networkInfo != null && networkInfo.isConnected())
return true;
else
return false;
}
}
Error13, 61) error: cannot find symbol method getSystemService(String)