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();
}
Aggregations