@SuppressWarnings("deprecation") private void registerBroadcastReceivers() { if (networkConnectionMonitor == null) { networkConnectionMonitor = new NetworkConnectionIntentReceiver(); registerReceiver(networkConnectionMonitor, new IntentFilter( ConnectivityManager.CONNECTIVITY_ACTION)); } if (Build.VERSION.SDK_INT < 14 /**Build.VERSION_CODES.ICE_CREAM_SANDWICH**/) { // Support the old system for background data preferences ConnectivityManager cm = (ConnectivityManager) getSystemService(CONNECTIVITY_SERVICE); backgroundDataEnabled = cm.getBackgroundDataSetting(); if (backgroundDataPreferenceMonitor == null) { backgroundDataPreferenceMonitor = new BackgroundDataPreferenceReceiver(); registerReceiver( backgroundDataPreferenceMonitor, new IntentFilter( ConnectivityManager.ACTION_BACKGROUND_DATA_SETTING_CHANGED)); } } }
@SuppressWarnings("deprecation") private void registerBroadcastReceivers() { if (networkConnectionMonitor == null) { networkConnectionMonitor = new NetworkConnectionIntentReceiver(); registerReceiver(networkConnectionMonitor, new IntentFilter( ConnectivityManager.CONNECTIVITY_ACTION)); } if (Build.VERSION.SDK_INT < 14 /**Build.VERSION_CODES.ICE_CREAM_SANDWICH**/) { // Support the old system for background data preferences ConnectivityManager cm = (ConnectivityManager) getSystemService(CONNECTIVITY_SERVICE); backgroundDataEnabled = cm.getBackgroundDataSetting(); if (backgroundDataPreferenceMonitor == null) { backgroundDataPreferenceMonitor = new BackgroundDataPreferenceReceiver(); registerReceiver( backgroundDataPreferenceMonitor, new IntentFilter( ConnectivityManager.ACTION_BACKGROUND_DATA_SETTING_CHANGED)); } } }
@SuppressWarnings("deprecation") private void registerBroadcastReceivers() { if (networkConnectionMonitor == null) { networkConnectionMonitor = new NetworkConnectionIntentReceiver(); registerReceiver(networkConnectionMonitor, new IntentFilter( ConnectivityManager.CONNECTIVITY_ACTION)); } if (Build.VERSION.SDK_INT < 14 /**Build.VERSION_CODES.ICE_CREAM_SANDWICH**/) { // Support the old system for background data preferences ConnectivityManager cm = (ConnectivityManager) getSystemService(CONNECTIVITY_SERVICE); backgroundDataEnabled = cm.getBackgroundDataSetting(); if (backgroundDataPreferenceMonitor == null) { backgroundDataPreferenceMonitor = new BackgroundDataPreferenceReceiver(); registerReceiver( backgroundDataPreferenceMonitor, new IntentFilter( ConnectivityManager.ACTION_BACKGROUND_DATA_SETTING_CHANGED)); } } }