Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Determinate ProgressDialog in Android

I want to have a ProgressDialog with determinate progress bar instead of default spinner. It seems to be easy: ProgressDialog has method setIndeterminate, and method show accepts a boolean to indicate indeterminateness. But these way don't work for me! The dialog is still indeterminate with a spinner. How to change the behaviour?

like image 795
aplavin Avatar asked Mar 31 '12 13:03

aplavin


1 Answers

You need call:

progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);

Check out the official dev guide Showing a progress bar with the example source code attached to that section.

like image 167
yorkw Avatar answered Sep 30 '22 14:09

yorkw