I use ToolBar from Material design.

You need to add a button in the Toolbar update when you click on which the ProgressBar comes and then the update is completed. How can I realize all this?

Search in English-speaking forums and githaba did not give any results.

    1 answer 1

    1. Create an xml file with the menu resources
    2. Add it to the toolbar
    3. Hang a click listener on it.
    4. In the listener, perform the desired action — launching the task and displaying progress.
    5. Stop the progress at the end of the task.
    • What kind of listeners will be relevant to the topic? * - elik
    • Depending on how you will do it. For example onOptionsItemsSelected - JuriySPb
    • I did it all from the side, but how did the progress bar go in there? - elik
    • Where do you want? Start your animation better in markup or use SwipeRefreshLayout - YuriiSPb
    • This is where I have 3 tabs of a fragment and on 2 tabs using 3d tour of the object and there swipeRefreshLayout more than interferes with the management, so you need to add a hubbar - elik