Android - how to pass context parameter to a method?
问题 I'm trying to develop a simple app for my daughter but I'm not a professional :) I was wondering how you can pass a context to a Boolean method? My issue is, when trying to merge both codes below private boolean isNetworkAvailable() { ConnectivityManager connectivityManager = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo(); return activeNetworkInfo != null;} with public static boolean