Skip to content Skip to sidebar Skip to footer

Casting A Menu Item In XML To A Spinner (Actionbar Appcompat)

I'm having some trouble casting a Menu Item in xml to a Spinner (actionbar compat) . I've tried a couple of options, like these Spinner as MenuItem not initialized by findViewById

Solution 1:

getActionView() of my MenuItem return null answers it all:

getActionView() only works if there's a custom actionView from setActionView.

Why though, I have No idea. Why they dont in the example here http://developer.android.com/guide/topics/ui/actionbar.html#ActionView , who knows.


Post a Comment for "Casting A Menu Item In XML To A Spinner (Actionbar Appcompat)"