Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/217.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何在使用multipartentity上载视频文件时显示progressbar_Java_Android - Fatal编程技术网

Java 如何在使用multipartentity上载视频文件时显示progressbar

Java 如何在使用multipartentity上载视频文件时显示progressbar,java,android,Java,Android,我正在使用multipartentity上传视频文件和数据。如何在一个键值中显示progressbar和上传数组值 我正在使用以下代码: DefaultHttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = new HttpPost(Call_Server.REPLAY_VIDEO); MultipartEntity m

我正在使用multipartentity上传视频文件和数据。如何在一个键值中显示progressbar和上传数组值

我正在使用以下代码:

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

好的,您可以使用线程功能。

使用线程上传数据,使用runOnUiThread显示进度条。也可以使用asyn任务