class SettingsActivity extends PreferenceActivity implements Preference.OnPreferenceChangeListener, Preference.OnPreferenceClickListener, View.OnClickListener {

    @Override
    public void onClick(View view) {

        String newValue = baseUrlEditTextPreference.getEditText().getText().toString();
        if (newValue != null && UrlUtil.isValidUrl(newValue)) {
            baseUrlEditTextPreference.onClick(null, DialogInterface.BUTTON_POSITIVE);
            dialog.dismiss();
        } else {
            Utils.showShortToast(baseUrlEditTextPreference.getContext(), baseUrlEditTextPreference.getContext().getString(R.string.invalid_url_massage));
        }

    }

}