@Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    addPreferencesFromResource(R.xml.rcs_settings_presence_preferences);
    setTitle(R.string.rcs_settings_title_presence_settings);

    freetextEdit1 = (EditTextPreference) findPreference("edit_freetext1");
    freetextEdit1.setPersistent(false);
    freetextEdit1.setOnPreferenceChangeListener(this);
    String txt1 = RcsSettings.getInstance().getPredefinedFreetext1();
    freetextEdit1.setText(txt1);
    freetextEdit1.setTitle(txt1);

    freetextEdit2 = (EditTextPreference) findPreference("edit_freetext2");
    freetextEdit2.setPersistent(false);
    freetextEdit2.setOnPreferenceChangeListener(this);
    String txt2 = RcsSettings.getInstance().getPredefinedFreetext2();
    freetextEdit2.setText(txt2);
    freetextEdit2.setTitle(txt2);

    freetextEdit3 = (EditTextPreference) findPreference("edit_freetext3");
    freetextEdit3.setPersistent(false);
    freetextEdit3.setOnPreferenceChangeListener(this);
    String txt3 = RcsSettings.getInstance().getPredefinedFreetext3();
    freetextEdit3.setText(txt3);
    freetextEdit3.setTitle(txt3);

    freetextEdit4 = (EditTextPreference) findPreference("edit_freetext4");
    freetextEdit4.setPersistent(false);
    freetextEdit4.setOnPreferenceChangeListener(this);
    String txt4 = RcsSettings.getInstance().getPredefinedFreetext4();
    freetextEdit4.setText(txt4);
    freetextEdit4.setTitle(txt4);

    vibrateInvitation = (CheckBoxPreference) findPreference("presence_invitation_vibration");
    vibrateInvitation.setPersistent(false);
    vibrateInvitation.setOnPreferenceChangeListener(this);
    vibrateInvitation.setChecked(RcsSettings.getInstance().isPhoneVibrateForPresenceInvitation());
  }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    addPreferencesFromResource(R.xml.rcs_settings_userprofile_preferences);

    displaynameEdit = (EditTextPreference) findPreference("edit_displayname");
    displaynameEdit.setPersistent(false);
    displaynameEdit.setOnPreferenceChangeListener(this);

    if (!isServiceConnected(RcsServiceName.FILE_TRANSFER)) {
      showMessage(R.string.label_service_not_available);
      return;
    }

    try {
      String name = getContactApi().getCommonConfiguration().getMyDisplayName();
      displaynameEdit.setText(name);
      displaynameEdit.setTitle(name);

    } catch (RcsServiceException e) {
      showExceptionThenExit(e);
    }
  }