Package com.cloudinary.android.callback
Interface UploadCallback
- All Known Implementing Classes:
ListenerService
public interface UploadCallback
Callback for progress and results of an upload operation.
-
Method Summary
Modifier and Type Method Description voidonError(java.lang.String requestId, ErrorInfo error)Called when a request encounters an error.voidonProgress(java.lang.String requestId, long bytes, long totalBytes)Called on upload progress updates.voidonReschedule(java.lang.String requestId, ErrorInfo error)Called when a request fails with a recoverable error and is rescheduled to a later time.voidonStart(java.lang.String requestId)Called when a request starts uploading.voidonSuccess(java.lang.String requestId, java.util.Map resultData)Called when a requests completes successfully.
-
Method Details
-
onStart
void onStart(java.lang.String requestId)Called when a request starts uploading.- Parameters:
requestId- Id of the request sending this callback.
-
onProgress
void onProgress(java.lang.String requestId, long bytes, long totalBytes)Called on upload progress updates.- Parameters:
requestId- Id of the request sending this callback.bytes- Total bytes uploaded so far.totalBytes- Total bytes to upload (if known).
-
onSuccess
void onSuccess(java.lang.String requestId, java.util.Map resultData)Called when a requests completes successfully.- Parameters:
requestId- Id of the request sending this callback.resultData- Result data about the newly uploaded resource.
-
onError
Called when a request encounters an error.- Parameters:
requestId- Id of the request sending this callback.error- Error object containing description and code.
-
onReschedule
Called when a request fails with a recoverable error and is rescheduled to a later time. This is useful to update UI (e.g hide progress notifications), otherwise this callback can be ignored.- Parameters:
requestId- Id of the request sending this callback.error- Error object containing technical description and code.
-