I am trying to obtain a handle on one of the views in the Action Bar. I have tried calling:
but this returns null unless I call it in the onOptionsItemSelected method. I have also tried calling it from a different object:
but this has not worked. How can I do this?
(I am not using the ActionBarSherlock library, by the way. Also, this is not a custom ActionView.)
I am trying to obtain a handle on one of the views in the Action Bar
I will assume that you mean something established via
android:actionLayout in your
<item> element of your
I have tried calling findViewById(R.id.menu_item)
To retrieve the
View associated with your
findItem() on the
Menu to retrieve the
MenuItem, then call
getActionView() on the
MenuItem. This can be done any time after you have inflated the menu resource.