app/src/main/java/id/rainey/master/utils/NetworkUtil.java
//check whether mobile data or Wi-Fi is connected
check whether mobile data or Wi-Fi is connected
check whether mobile data or Wi - Fi is connected
public static boolean isNetworkConnected() {
        Context context = Application.getContext();
        ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
        NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo();
        return (activeNetworkInfo != null && activeNetworkInfo.isConnected());
    }
public static boolean isNetworkConnected ( ) { Context context = Application . getContext ( ) ; ConnectivityManager connectivityManager = ( ConnectivityManager ) context . getSystemService ( Context . CONNECTIVITY_SERVICE ) ; NetworkInfo activeNetworkInfo = connectivityManager . getActiveNetworkInfo ( ) ; return ( activeNetworkInfo != null && activeNetworkInfo . isConnected ( ) ) ; }
check whether mobile data or Wi-Fi is connected
check whether mobile data or Wi - Fi is connected