I've just discovered that setting the
choiceMode attribute of the
ListView element in the XML layout doesn't work on Android 1.5. Comparing
ListView.java from 1.5 and 1.6 releases reveals the following difference (among others):
@@ -166,6 +174,8 @@ setDividerHeight(dividerHeight); } + setChoiceMode(a.getInt(R.styleable.ListView_choiceMode, CHOICE_MODE_NONE)); + mHeaderDividersEnabled = a.getBoolean(R.styleable.ListView_headerDividersEnabled, true); mFooterDividersEnabled = a.getBoolean(R.styleable.ListView_footerDividersEnabled, true);
The change is inside
ListView's constructor. Looks like someone has forgotten to add the code to retrieve the
choiceMode attribute, and that was fixed in 1.6. I've found no ticket for that in the Android tracker, however.
Anyway, if you want your code to be 1.5-compatible, you'd rather call
setChoiceMode() explicitly in your code.