Show Progress Bar with Text and Title in Android

In an Android application using web services or any other operations like downloading data or any process which may take time to get completed, it is always a good social behavior to show a decent progress message. A simple loader image can’t tell much about the process going on. So here we will discuss three methods of showing progress bars.

  1. Progress Bar with loader icon and message with it.
  2. Progress Bar with loader icon, title, and message with it.
  3. Progress Bar with loader icon, title, percentage and message with it.

Show Progress Bar with loader icon and message with it.

Activity’s onCreate method add following code

After the onCreate method add below two methods to show and hide ProgressBar loader.

 

Show Progress Bar with Title and Text beside loader icon.

 

Activity’s onCreate method add following code

After the onCreate method add below two methods to show and hide ProgressBar loader.

 

Show Progress Bar with Title, Text and Progress Percentage of Downloading beside loader icon.

Add the following code before onCreate method.

Activity’s onCreate method add following code

After the onCreate method add below two methods to show and hide ProgressBar loader.

 

let me know if you face any issue.

Happy coding…   🙂

2
Leave a Reply

avatar
2 Comment threads
0 Thread replies
2 Followers
 
Most reacted comment
Hottest comment thread
2 Comment authors
Lokisarlanori Recent comment authors
  Subscribe  
newest oldest most voted
Notify of
sarlanori
Guest
sarlanori

You are talking about ProgressDialog, not ProgressBar.

Loki
Guest

above code give us the error
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method ‘void android.app.ProgressDialog.setProgressStyle(int)’ on a null object reference
progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);