Code example for ConnectivityManager

Methods: setMobileDataEnabled

0
        return (mConnService.getMobileDataEnabled() ? 1 : 0);
    } 
 
    protected void setPreferenceStatus(int status) {
        if (status == 1) {
            mConnService.setMobileDataEnabled(true);
        } 
        else { 
            mConnService.setMobileDataEnabled(false);
        } 
    } 
}