8

How do you use

<item android:drawable="@drawable/ic_launcher" android:state_activated="true"/>

for list view items in an apps that should also run on devices <11 ?

Since activated_state is not available before HC, I can only think of two dirty workarounds:

  1. Maintain the activated_state manually in your Activity.
  2. Maintain the activated element in my custom ListAdapter

But either one is satisfying. (getListView().setChoiceMode(...) wouldn't have an effect,...)

Any other ideas?

Johannes Staehlin
  • 3,680
  • 7
  • 36
  • 50

1 Answers1

3

have you had a look to this tutorial ?

http://mobile.tutsplus.com/tutorials/android/android-compatibility-list-indicators-on-honeycomb/

Tom
  • 962
  • 1
  • 14
  • 32
  • It does not work for pre-honeycomb, see step 4 from your link – Lonli-Lokli Apr 07 '14 at 19:52
  • the issue has been addressed there since :http://stackoverflow.com/questions/13531272/state-activated-on-pre-honeycomb-devices?noredirect=1&lq=1 – Tom Dec 14 '16 at 20:46