开发者

How to Override progress bar progress message i.e.. 61/100 to a custom message as 0 remaining out of 100 [duplicate]

开发者 https://www.devze.com 2023-03-05 05:44 出处:网络
This question already has answers here: Closed 11 years ago. Possible Duplicate: Progress unit in ProgressDialog
This question already has answers here: Closed 11 years ago.

Possible Duplicate:

Progress unit in ProgressDialog

How to Override progress bar progress message i.e.. 61/100 to a custom message as 0 remaining out of 100 [duplicate]

How to Ove开发者_开发百科rride progress bar progress message i.e.. 61/100 to a custom message as 10 remaining out of 100


ProgressDialog has method setProgressNumberFormat(). It's exactly what you need.

In your case:

progressDialog.setProgressNumberFormat("%1d remaining out of %2d");

Of course, it's better to define the string in resources.

Upd: This method available only in Android 3.0. As alternative you can implement your own ProgressDialog or just copy implementation from Android sources as mentioned in Progress unit in ProgressDialog.

0

精彩评论

暂无评论...
验证码 换一张
取 消