Search in sources :

Example 1 with EmailConfig

use of ca.rmen.android.networkmonitor.app.email.EmailPreferences.EmailConfig in project network-monitor by caarmen.

the class EmailPreferencesActivity method onBackPressed.

@Override
public void onBackPressed() {
    Log.v(TAG, "onBackPressed");
    int emailInterval = EmailPreferences.getInstance(this).getEmailReportInterval();
    // If the user enabled sending e-mails, make sure we have enough info.
    if (emailInterval > 0) {
        EmailConfig emailConfig = EmailPreferences.getInstance(this).getEmailConfig();
        if (!emailConfig.isValid()) {
            ListPreference preference = (ListPreference) mPreferenceFragment.findPreference(EmailPreferences.PREF_EMAIL_INTERVAL);
            preference.setValue("0");
            DialogFragmentFactory.showInfoDialog(this, getString(R.string.missing_email_settings_info_dialog_title), getString(R.string.missing_email_settings_info_dialog_message));
            updatePreferenceSummary(EmailPreferences.PREF_EMAIL_INTERVAL, R.string.pref_summary_email_report_interval);
            return;
        }
    }
    super.onBackPressed();
}
Also used : EmailConfig(ca.rmen.android.networkmonitor.app.email.EmailPreferences.EmailConfig) ListPreference(android.support.v7.preference.ListPreference) MultiSelectListPreference(android.support.v14.preference.MultiSelectListPreference)

Aggregations

MultiSelectListPreference (android.support.v14.preference.MultiSelectListPreference)1 ListPreference (android.support.v7.preference.ListPreference)1 EmailConfig (ca.rmen.android.networkmonitor.app.email.EmailPreferences.EmailConfig)1