Code example for ConnectivityManager

Methods: setMobileDataEnabled

        ConnectivityManager cm =
        PowerManager pm = (PowerManager)getSystemService(Context.POWER_SERVICE);
        pm.goToSleep( SystemClock.uptimeMillis() );
     * Does n't need to do anything wrt Device-Resume., This activity's onResume() is called soon after 
     * the Device-Resume happens by POWER-key press., 
     * So, if the Airplane Mode was earlier enabled by us, lets disable it and bring back the state to 
     * the Device's original state. 
    private void restoreOriginalState() { 
        Log.d(TAG, "restoreOriginalState() : " + SystemClock.elapsedRealtime());
        // Enable keypad , Disable airplane-mode as we are entering RESUME state