I am using Android compat library to show a ActionBar at the top of the screen.
The actionBar contains a refresh button which is a rotating circle if it is pressed.
To activate the rotation of the circle in the actionBar I use following:
getActionBarHelper().setRefreshActionItemState(true);
This works fine, if I call it via a button click or via onOptionsItemSelected().
But if I call it in onCreate or onStart nothing happens. I am wondering why?
Remember that the rotating circle only appears once
onCreateOptionsMenuhas been executed. It means that it will not appear if you try to executegetActionBarHelper().setRefreshActionItemState(true)on your Activity “onCreate”. If you try on “onResume” it will work. You can use it wherever you need onceonCreateOptionsMenuhas been executed.I hope it helps you.