Skip to content Skip to sidebar Skip to footer

Getting Menu Item To Animate

I'm trying to animate a menu item, while the activity is loading, in my ActionBar (actually ActionBarSherlock). The code I have works the first time the activity is created, but a

Solution 1:

onCreateOptionsMenu will always be called after onCreate. In fact, onCreate will always be the first method called when an activity is created.

You should either assign the loadingItem variable before you use it, or declare it as static so that the reference isn't deleted when the activity is destroyed (which still may happen, in which case I recommend the first option).

Why not set the animation in onCreateOptionsMenu?

Post a Comment for "Getting Menu Item To Animate"