Nevermind.  I see now that actionbar Views can be obtained with
Activity.findViewById(id), where the id comes from
MenuItem.getItemId() for the corresponding MenuItem.

Thanks for the help.

On Feb 7, 7:18 am, Ab <[email protected]> wrote:
> 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 <[email protected]> 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 <[email protected]> ÎÁÐÉÓÁÌ:
>
> > > 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 [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

-- 
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