12

I am using progress dialog for android 2.3.3. Progress dialog's status is showing with the format as "60% 60/100" but I want to display only percentage not "60/100". How can I do it? please help.

Dhanesh
  • 781
  • 2
  • 9
  • 16

2 Answers2

20

According to documentation, you should call setProgressNumberFormat (null) on your ProgressDialog instance to get this behavior

OleGG
  • 8,589
  • 1
  • 28
  • 34
  • 2
    the method that you have mentioned is applicable for api level 11. mine is 10 – Dhanesh Jan 28 '12 at 07:38
  • 1
    My bad :( I've dig into source code and find out that there is no "normal" way to do it in api 10. I just can propose as workaround to get full ProgessDialog code from Android 4.0.1 and use it instead of built-in version. Maybe, it'll be some mess with android "internal" resources, but it is also available as sources to reuse. – OleGG Jan 28 '12 at 08:13
1

Please visit this link.

Also It's explained in full in ApiDemos inside the SDK. The example that you want is named: ProgressBar3.java and can be found in \ApiDemos\src\com\example\android\apis\view\

Also, if you want to remove the borders of the dialog so that only the progress bar appears you can define the dialog itself as a transparent view/overlay (it's explained in the examples as well).

Lucifer
  • 29,392
  • 25
  • 90
  • 143