Ejemplo n.º 1
0
  private void beginMmsSetup() {
    if (!mPrefs.getBoolean(MMS_SETUP_DONT_ASK_AGAIN, false)
        && TextUtils.isEmpty(mPrefs.getString(SettingsFragment.MMSC_URL, ""))
        && TextUtils.isEmpty(mPrefs.getString(SettingsFragment.MMS_PROXY, ""))
        && TextUtils.isEmpty(mPrefs.getString(SettingsFragment.MMS_PORT, ""))) {

      // Launch the MMS setup fragment here. This is a series of dialogs that will guide the
      // user through the MMS setup process.
      FragmentManager manager = getFragmentManager();
      if (manager.findFragmentByTag(MMSSetupFragment.TAG) == null) {
        MMSSetupFragment f = new MMSSetupFragment();
        Bundle args = new Bundle();
        args.putBoolean(MMSSetupFragment.ARG_ASK_FIRST, true);
        args.putString(MMSSetupFragment.ARG_DONT_ASK_AGAIN_PREF, MMS_SETUP_DONT_ASK_AGAIN);
        f.setArguments(args);

        getFragmentManager().beginTransaction().add(f, MMSSetupFragment.TAG).commit();
      }
    }
  }
Ejemplo n.º 2
0
  private boolean hasSetupMms() {
    if (TextUtils.isEmpty(mPrefs.getString(SettingsFragment.MMSC_URL, ""))
        && TextUtils.isEmpty(mPrefs.getString(SettingsFragment.MMS_PROXY, ""))
        && TextUtils.isEmpty(mPrefs.getString(SettingsFragment.MMS_PORT, ""))) {

      // Not so fast! You need to set up MMS first.
      MMSSetupFragment f = new MMSSetupFragment();
      Bundle args = new Bundle();
      args.putBoolean(MMSSetupFragment.ARG_ASK_FIRST, true);
      f.setArguments(args);

      ((Activity) mContext)
          .getFragmentManager()
          .beginTransaction()
          .add(f, MMSSetupFragment.TAG)
          .commit();

      return false;
    }

    return true;
  }