protected void initializePopup() {
    LayoutInflater inflater =
        (LayoutInflater) mActivity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);

    MoreSettingPopup popup =
        (MoreSettingPopup) inflater.inflate(R.layout.more_setting_popup, null, false);
    popup.setSettingChangedListener(this);
    popup.initialize(mPreferenceGroup, mOtherKeys);
    mPopup = popup;
  }
  protected void initializePopup() {
    LayoutInflater inflater =
        (LayoutInflater) mActivity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);

    MoreSettingPopup popup =
        (MoreSettingPopup) inflater.inflate(R.layout.more_setting_popup, null, false);
    popup.setSettingChangedListener(this);
    popup.initialize(mPreferenceGroup, mOtherKeys);
    if (mActivity.isSecureCamera()) {
      // Prevent location preference from getting changed in secure camera mode
      popup.setPreferenceEnabled(CameraSettings.KEY_RECORD_LOCATION, false);
    }
    mPopup = popup;
  }
 @Override
 public void reloadPreferences() {
   super.reloadPreferences();
   if (mPopup != null) {
     mPopup.reloadPreference();
   }
 }
 @Override
 public void overrideSettings(final String... keyvalues) {
   super.overrideSettings(keyvalues);
   if (mPopup == null || mPopupStatus != POPUP_FIRST_LEVEL) {
     mPopupStatus = POPUP_FIRST_LEVEL;
     initializePopup();
   }
   ((MoreSettingPopup) mPopup).overrideSettings(keyvalues);
 }
 @Override
 // Hit when an item in the second-level popup gets selected
 public void onListPrefChanged(ListPreference pref) {
   if (mPopup != null && mSecondPopup != null) {
     mModule.dismissPopup(true);
     mPopup.reloadPreference();
   }
   onSettingChanged(pref);
 }
 @Override
 public void overrideSettings(final String... keyvalues) {
   super.overrideSettings(keyvalues);
   if (mPopup == null) initializePopup();
   mPopup.overrideSettings(keyvalues);
 }