Android Progressbar is shown when there is a background task running and to show the user about the status of the task.In android there are two typesof progressbar are used they are

 

       1.Indeterminate ProgressBar

Indeterminate ProgressBar is used when fetching the data or a task where the time i.e., duration of the task is not known.It may be completed quickly or may take some time there will be a circular type of animation shown for a unknown period.

In this tutorial we will create a indeterminate progress bar.

 

      2. Determinate ProgressBar

Determinate ProgressBar is having a specific amount of time like when you download a filed from internet you will be show a determinate progressbar which will show the remaining time, size of the file, and many more parameters depending upon the requirement.

For more info visit

Tutorial on Determinate ProgressBar

 

Now lets design a circular progressbar to be shown

 

customprogress

 

 

then add this progress shape to progress dialog

 

activity_main

 

 

 

then make a custom progress dialog class which can be used any where in the app where we need to show progress dialog.

 

CustomProgressDialog

 

 

then we can use this progress dialog as

 

 

MainActivity

Output

 

Share this tutorial if you like any query’s comment below.

 

Show Buttons
Hide Buttons
Read previous post:
Android Parsing Local Json Url || Fetching data from local URL

Close