Android: ActionBar Item Animation

2019-07-28 12:00发布

问题:

I want to apply a rotate Animation to an action in my ActionBar. For the ActionBar I´m using ActionBarSherlock.

My problem is, that in all Solutions I found (e.g. Animated Icon for ActionItem) they are getting the MenuItem which shall be animated in onOptionsItemSelected(MenuItem item).

But I want to be able to start the animation even BEFORE some action is selected. So how can I get the MenuItem?

回答1:

Call findItem() on the Menu supplied to onCreateOptionsMenu().