I have in my Action Bar an item to display progress (a ProgressBar) if a request is occurring. When the request occurs, I must show the ProgressBar and hide the other items, when the request ends, I must hide the ProgressBar and show the other items.
Dictionaries
The request, that is, my AsyncTask, is executed when I start my Activity (in fact, it is a Fragment), that is, before the operating system invokes the creation of the menu with onCreateOptionsMenu()
.
I need to retrieve and manipulate the items from a Action Bar outside the scope of the onCreateOptionsMenu()
, ie at the beginning and at the end of AsyncTask.
Note
AsyncTask is declined in a separate class. Activity delegates to a class that manipulates and manages the methods of this AsyncTask.
How to manipulate an ActionBar outside the scope of onCreateOptionsMenu()
?