I have an application that crashes on ICS. Worked well before that (although I'm not sure that I ever really got a honeycomb platform for testing, all of our test phones are gingerbread or lower, and now I have several ICS phones to play with).
The following code (called from onResume and OnPreferenceChangeListener) from my settings page worked fine:
protected void setBatteryAlarmSummary(String newValue){ Preference batteryAlarm = (Preference) findPreference( getString(R.string.battery_low_alarm) ); StringBuilder summary = new StringBuilder(); summary.append(getString(R.string.battery_alarm_summary_label)); summary.append(" "); summary.append(newValue); summary.append("%"); batteryAlarm.setSummary(summary); }
This sets the preliminary summary to โLow Battery Signal at 10%โ. Now, with ICS, he is falling. Not when it does setSummary, and not when the page is displayed, but when you scroll through the settings a bit, obviously causing a rendering (this element has about 8 or so elements, so it is โbelow the foldโ in the list). Fixing ICS is easy, just avoid the percent sign:
summary.append("%%");
However, this code on the gingerbread displays displays "Low Battery Alarm at 10 %%"
I can write it for a change based on the version, but that is just plain stupid. Did they really break backward compatibility when rendering their preferences, or is it just a Samsung thing (which, unfortunately, is the only test platform for ICS)?
source share