Concatenate text in a ProgressDialog

1

Situation

I have a following ProgressDialog defined with STYLE_HORIZONTAL in which it executes after getting the size of a download of a file. This way, I define its size using .setMax(tamanho) . After setting the size, it starts downloading and runs the bar until the end of the progress . There is a text below in the ProgressDialog which means the percentage and the total size, in which it is automatically set as shown in the image:

Image

Code

ProgressDialog progressDialog = new ProgressDialog(this);
progressDialog.setMessage(getResources().getString(R.string.str_title_download_new_version));
                        progressDialog.setProgressStyle(progressDialog.STYLE_HORIZONTAL);
                        progressDialog.setCancelable(false);
                        progressDialog.show();

Setting the Environment

  • IDE: Eclipse Mars 2
  • Target SDK: Android 2.3.3 - Api Level 10

Doubt

I would like to concatenate two letters at the end of 1311/4140 to refer to megabytes , for example: Mb . I did some research but I did not succeed. Is there any way to do this concatenation in ProgressDialog ?

Hugs! =)

    
asked by anonymous 01.09.2016 / 20:36

0 answers