Code example for ConnectivityManager

Methods: getMobileDataEnabled

0
        cm.setMobileDataEnabled(checked);
    } 
 
    private boolean getMobileData() { 
        ConnectivityManager cm = (ConnectivityManager) mContext.getSystemService(Context.CONNECTIVITY_SERVICE);
        return cm.getMobileDataEnabled();
    } 
 
} 
Connect your IDE to all the code out there  Get Codota for Java