コード例 #1
0
 @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);
   }
 }
コード例 #2
0
 /** 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);
 }