title: Multiple progress bar on image
body: <p>I have multiple images and i am uploading on php server using asynctask my problem is i want to show circular progress bar on every image individually like whatsapp but don't know how to do. here is my code</p>
  
  <pre><code>/**
   * Uploading the file to server
   * */
  private class UploadFileToServer extends AsyncTask&lt;Void, Integer, String&gt; {
      @Override
      protected void onPreExecute() {
  
          super.onPreExecute();
      }
  
      @Override
      protected void onProgressUpdate(Integer... progress) {
  
      }
  
      @Override
      protected String doInBackground(Void... params)
      {
          return uploadFile();
      }
  
      @SuppressWarnings("deprecation")
      private String uploadFile() {
          String responseString = null;
  
          HttpClient httpclient = new DefaultHttpClient();
          HttpPost httppost = new HttpPost(serviceurl+"conversations.php");
  
  
          try {
              MultipartEntityBuilder entity = MultipartEntityBuilder.create();        
  
  
  
  
              /* example for setting a HttpMultipartMode */
              entity.setMode(HttpMultipartMode.BROWSER_COMPATIBLE);
  
  
              File sourceFile = new File(imgDecodableString);
  
  
              // Progress listener - updates task's progress
              MyHttpEntity.ProgressListener progressListener =
                      new MyHttpEntity.ProgressListener() {
                          @Override
                          public void transferred(float progress) {
                             publishProgress((int) progress);
  
                          }
                      };
  
              // Adding file data to http body
              entity.addPart("file", new FileBody(sourceFile));
  
              // Extra parameters if you want to pass to server
                      entity.addTextBody("from_user",(prefid.getString("userid", null)),ContentType.TEXT_PLAIN);
              entity.addTextBody("to_user",touser_id,ContentType.TEXT_PLAIN);
              entity.addTextBody("message_type", msg_type,ContentType.TEXT_PLAIN);    
  
              httppost.setEntity(new MyHttpEntity(entity.build(),
                      progressListener));
  
              // Making server call
              HttpResponse response = httpclient.execute(httppost);
              HttpEntity r_entity = response.getEntity();
  
              int statusCode = response.getStatusLine().getStatusCode();
              if (statusCode == 200) {
  
  
                  responseString = EntityUtils.toString(r_entity);
              } else {
                  responseString = "Error occurred! Http Status Code: "
                          + statusCode;
              }
  
          } catch (ClientProtocolException e) {
              responseString = e.toString();
          } catch (IOException e) {
              responseString = e.toString();
          }
  
          return responseString;
  
      }
  
      @Override
      protected void onPostExecute(String result) {
          super.onPostExecute(result);
  
  
  
      }
  
  }
  </code></pre>
  
  <p>I am calling above code in my main activity and i am using this to upload images and video. </p>
  
  <p>please help me how i can set progress bar on multiple images same as in whatsapp</p>
  
  <p>Thanks</p>