@Override public void onReceive(Context context, Intent intent) { final String action = intent.getAction(); if (LocationManager.HIGH_POWER_REQUEST_CHANGE_ACTION.equals(action)) { updateActiveLocationRequests(); } else if (LocationManager.MODE_CHANGED_ACTION.equals(action)) { mHandler.sendEmptyMessage(H.MSG_LOCATION_SETTINGS_CHANGED); } }
/** Add a callback to listen for changes in location settings. */ public void addSettingsChangedCallback(LocationSettingsChangeCallback cb) { mSettingsChangeCallbacks.add(cb); mHandler.sendEmptyMessage(H.MSG_LOCATION_SETTINGS_CHANGED); }