Hello Vadim!

Have you already found a solution?

I had the same problem... But I solved it!

I did 2 things:

   1. I added `android:background="?android:attr/
   activatedBackgroundIndicator"` to my Custom Row layout. I don't know 
   about the android.R.layout.simple_list_item_activated_1 style, but I guess 
   it should work too...
   2. In my `OnItemLongClickListener` I added 
`listView.setItemChecked(position, 
   true);`
   This, however, added a new problem: the item wouldn't get deselected 
   when closing the ActionBar, so in `onDestroyActionMode(ActionMode mode)`, 
   I added: 
   `listView.clearChoices();`
   `listView.requestLayout();`

Greetings,
Sven

On Saturday, October 20, 2012 12:14:43 AM UTC+2, Vadim Peretokin wrote:
>
> I'm using a ListView with the 
> android.R.layout.simple_list_item_activated_1 style used on an ArrayAdapter 
> for the TextView elements, similar to the List16.java example.
>
> I'd like my ListView to have multi-selection, so I implemented 
> MultiChoiceModeListener and set the CHOICE_MODE_MULTIPLE_MODAL. 
> Long-pressing on an item correctly opens the CAB, however I have an issue 
> with item selection - items in the lists don't visually change as they are 
> selected/deselected in this mode.
>
> As far as I understand, 
> android:background="?android:attr/activatedBackgroundIndicator" is 
> responsible for the background colour on the state change - and so this 
> does not seem to be working.
>
> I'm using ABS 4.2.0 in my app as well. Any ideas what could be wrong?
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to