Checking Device has internet connection
问题 I followed this Keep checking if Device has internet connection to check internet connectivity using BroadcastReceiver, the problem is how to call this registerReceiver(mConnReceiver, new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION)); from main activity 回答1: Try this: if(isNetworkStatusAvialable(getApplicationContext())) { }else { public static boolean isNetworkStatusAvialable(Context context) { ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService