From 3635dab3bada7c43cad4fa934e1690c8e616a99f Mon Sep 17 00:00:00 2001 From: Arne Jans Date: Tue, 18 Oct 2011 14:44:28 +0200 Subject: [PATCH] Symptom-fix for ArrayIndexOutOfBoundsException. Presumably happening during focusGain of the ReminderPreferences-activity for the default-remindertime settting. Details: https://www.crittercism.com/developers/crash-details/e0886dbfcf9e78a21d9f2e2a385c4c13e2f6ad2132ac24a3fa811144 --- .../com/todoroo/astrid/reminders/ReminderPreferences.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/astrid/plugin-src/com/todoroo/astrid/reminders/ReminderPreferences.java b/astrid/plugin-src/com/todoroo/astrid/reminders/ReminderPreferences.java index 26e35264e..3f3780cfd 100644 --- a/astrid/plugin-src/com/todoroo/astrid/reminders/ReminderPreferences.java +++ b/astrid/plugin-src/com/todoroo/astrid/reminders/ReminderPreferences.java @@ -54,8 +54,12 @@ public class ReminderPreferences extends TodorooPreferenceActivity { } } else if(r.getString(R.string.p_rmd_time).equals(preference.getKey())) { int index = AndroidUtilities.indexOf(r.getStringArray(R.array.EPr_rmd_time_values), (String)value); - String setting = r.getStringArray(R.array.EPr_rmd_time)[index]; - preference.setSummary(r.getString(R.string.rmd_EPr_rmd_time_desc, setting)); + if (index != -1 && index < r.getStringArray(R.array.EPr_rmd_time).length) { + // FIXME this does not fix the underlying cause of the ArrayIndexOutofBoundsException + // https://www.crittercism.com/developers/crash-details/e0886dbfcf9e78a21d9f2e2a385c4c13e2f6ad2132ac24a3fa811144 + String setting = r.getStringArray(R.array.EPr_rmd_time)[index]; + preference.setSummary(r.getString(R.string.rmd_EPr_rmd_time_desc, setting)); + } } else if(r.getString(R.string.p_rmd_ringtone).equals(preference.getKey())) { if(value == null || "content://settings/system/notification_sound".equals(value)) //$NON-NLS-1$ preference.setSummary(r.getString(R.string.rmd_EPr_ringtone_desc_default));