Ok, so I can use this to define a color for selected state, etc. But I still need to get a reference to the individual action item so that I can call View.setSelected(boolean).
I don't see anyway to get this reference from the ActionBar class, any ideas? On Feb 7, 6:06 am, Kostya Vasilyev <kmans...@gmail.com> wrote: > http://android-developers.blogspot.com/2011/04/customizing-action-bar... > > > > The individual action items inherit the default blue background when > selected. We can customise this behaviour by overriding > android:selectableItemBackground<http://developer.android.com/reference/android/R.styleable.html#Theme...> > and > setting a shape drawable with our desired colouring > << > > -- K > > 7 февраля 2012 г. 14:27 пользователь Ab <abe.oppenh...@gmail.com> написал: > > > > > > > > > I would like to programmatically set the background of an ActionBar > > item to draw as a specific color. > > > For a View I would accomplish this by setting the background of the > > View to a custom selector, which uses my specific color for the > > "selected" state; then I would call View.setSelected(boolean) to > > toggle the specific color on and off. > > > Is there a way to accomplish the same effect for items in the > > ActionBar? > > > -- > > You received this message because you are subscribed to the Google > > Groups "Android Developers" group. > > To post to this group, send email to android-developers@googlegroups.com > > To unsubscribe from this group, send email to > > android-developers+unsubscr...@googlegroups.com > > For more options, visit this group at > >http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en