将多个图像上载到服务器并显示它';s在android中的回收审查进展
将多个图像上传到服务器,并在android中的recycleview中显示其进度 我想在recycleview中显示多个图像上载进度 现在我正在使用通知将多个图像上载到服务器并显示它';s在android中的回收审查进展,android,android-recyclerview,image-uploading,Android,Android Recyclerview,Image Uploading,将多个图像上传到服务器,并在android中的recycleview中显示其进度 我想在recycleview中显示多个图像上载进度 现在我正在使用通知 public void uploadMultipart() { //getting the actual path of the image String path = getPath(filePath); //Uploading code try { String uploadId =
public void uploadMultipart() {
//getting the actual path of the image
String path = getPath(filePath);
//Uploading code
try {
String uploadId = UUID.randomUUID().toString();
//Creating a multi part request
new MultipartUploadRequest(this, uploadId, Constants.UPLOAD_URL)
.addFileToUpload(path, "image") //Adding file
.setNotificationConfig(new UploadNotificationConfig())
.setMaxRetries(2)
.startUpload(); //Starting the upload
} catch (Exception exc) {
Toast.makeText(this, exc.getMessage(), Toast.LENGTH_SHORT).show();
}
}
getPath方法
//method to get the file path from uri
public String getPath(Uri uri) {
Cursor cursor = getContentResolver().query(uri, null, null, null, null);
cursor.moveToFirst();
String document_id = cursor.getString(0);
document_id = document_id.substring(document_id.lastIndexOf(":") + 1);
cursor.close();
cursor = getContentResolver().query(
android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
null, MediaStore.Images.Media._ID + " = ? ", new String[]{document_id}, null);
cursor.moveToFirst();
String path = cursor.getString(cursor.getColumnIndex(MediaStore.Images.Media.DATA));
cursor.close();
return path;
}
我在那里更改代码。请帮助我在recycleview中显示上载进度
我想在我的应用程序中显示这样的图像上传进度。单击
对于示例屏幕截图。对于特定行或作为通知栏中的常规行?现在在通知栏中工作正常。。但是我想在我的appShare快照中显示您想要实现什么?我想在带有imageview的recycleview中显示每个图像上载的进度。您使用什么网络库进行图像上载。您需要创建回调以获取每次上载的进度,并动态更新特定行或通知栏中的RecycleServiceWF?现在在通知栏中工作正常。。但是我想在我的appShare快照中显示您想要实现什么?我想在带有imageview的recycleview中显示每个图像上载的进度。您使用什么网络库进行图像上载。您需要创建回调以获取每次上载的进度,并动态更新recyclerview