@Override
  protected void onDetachedFromWindow() {
    mObserver.unobserve();

    mWifiGroup = null;
    mWifi = null;
    mWifiActivity = null;
    mMobileGroup = null;
    mMobile = null;
    mMobileActivity = null;
    mMobileType = null;
    mSpacer = null;
    mAirplane = null;

    super.onDetachedFromWindow();
  }
Ejemplo n.º 2
0
 public void setListening(boolean listening) {
   if (mListening == listening) return;
   mListening = listening;
   for (TileRecord r : mRecords) {
     r.tile.setListening(mListening);
   }
   mFooter.setListening(mListening);
   if (mListening) {
     refreshAllTiles();
     mSettingsObserver.observe();
   } else {
     mSettingsObserver.unobserve();
   }
   if (listening && showBrightnessSlider()) {
     mBrightnessController.registerCallbacks();
   } else {
     mBrightnessController.unregisterCallbacks();
   }
 }
 @Override
 protected void onDetachedFromWindow() {
   super.onDetachedFromWindow();
   mSettingsObserver.unobserve();
 }