Android - I want to show file upload progress to the user

前端 未结 7 590
一向
一向 2020-12-07 14:51

I upload photo to the server via the default HttpClient in Android SDK. I want to show progress in the user interface, is there a way to find out how much has been uploaded?

7条回答
  •  离开以前
    2020-12-07 15:13

    I haven't used httpclient but I have done something like you want using AsyncTask.

        private class DownloadImageTask extends AsyncTask{
                protected Bitmap doInBackground(String... urls) {
    
                  while (myProgress

    See in background process I'm incrementing the progressbar and decoding image and in post execution I'm setting the image.

提交回复
热议问题