2013-04-29 71 views
0

我使用多方實體上傳視頻文件和數據。如何顯示進度欄並將數組值上傳到一個鍵值中?如何使用多方實體上傳視頻文件時顯示進度條

我使用下面的代碼:

   DefaultHttpClient httpclient = new DefaultHttpClient(); 
       HttpPost httppost = new HttpPost(Call_Server.REPLAY_VIDEO); 
       MultipartEntity mpEntity = new MultipartEntity(
         HttpMultipartMode.STRICT); 
       mpEntity.addPart("FILE_UPLOAD", new FileBody(videofile)); 
       mpEntity.addPart("message_id", new StringBody(recipient_id)); 
       mpEntity.addPart("recipient_email", new StringBody(recipient_email2)); 
       totalSize = (int) mpEntity.getContentLength(); 
       System.out.println(totalSize + ":::::totalSize"); 
       httppost.setEntity(mpEntity); 
       HttpResponse response = httpclient.execute(httppost); 
       HttpEntity resEntity = response.getEntity(); 

回答

1

使用線程上傳數據,並使用runOnUiThread顯示進度條。你也可以使用asyn任務。

0

好了,你可以使用Async Task線程功能。

相關問題