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();
4

2 回答 2

1

使用 Thread 上传数据,使用 runOnUiThread 显示进度条。您也可以使用异步任务。

于 2013-11-15T07:39:05.580 回答
0

好吧,您可以使用异步任务线程功能。

于 2013-04-29T14:13:23.760 回答