From 58b4b228b5c63f8eb621cfd4b46c299548d1838f Mon Sep 17 00:00:00 2001 From: Thomas Leing Date: Thu, 16 Feb 2023 15:53:26 -0800 Subject: [PATCH] Provide examples of storage pause/resume/start/cancel operations --- .../lib/storage/android/query-transfers.mdx | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/fragments/lib/storage/android/query-transfers.mdx b/src/fragments/lib/storage/android/query-transfers.mdx index 778b2f90150..7e3b616dc1a 100644 --- a/src/fragments/lib/storage/android/query-transfers.mdx +++ b/src/fragments/lib/storage/android/query-transfers.mdx @@ -10,6 +10,12 @@ Amplify.Storage.getTransfer("TRANSFER_ID", operation.setOnProgress( progress -> {}); operation.setOnSuccess( result -> {}); operation.setOnError(error -> {}); + + // possible actions + operation.pause(); + operation.resume(); + operation.start(); + operation.cancel(); }, { error -> Log.e("MyAmplifyApp", "Failed to query transfer", error) @@ -28,6 +34,12 @@ Amplify.Storage.getTransfer("TRANSFER_ID", operation.setOnProgress { } operation.setOnSuccess { } operation.setOnError { } + + // possible actions + operation.pause() + operation.resume() + operation.start() + operation.cancel() }, { error -> Log.e("MyAmplifyApp","Failed to query transfer", error) @@ -46,6 +58,12 @@ try { operation.setOnProgress { } operation.setOnSuccess { } operation.setOnError { } + + // possible actions + operation.pause() + operation.resume() + operation.start() + operation.cancel() } catch (error: StorageException) { Log.e("MyAmplifyApp", "Failed to query transfer", error) } @@ -64,6 +82,11 @@ RxAmplify.Storage.getTransfer("TRANSFER_ID") operation.setOnSuccess( result -> {}); operation.setOnError(error -> {}); + // possible actions + operation.pause(); + operation.resume(); + operation.start(); + operation.cancel(); }, error -> Log.e("MyAmplifyApp", "Failed to query transfer", error); );