public void addOnCompleteListenerTest() { Debug.Log("UploadTask addOnCompleteListenerTest"); byte[] data = new byte[10]; string filename = "addOnCompleteListenerTest.data"; StorageReference storageReference = mAGCStorageManagement.getStorageReference(filename); UploadTask task = storageReference.putBytes(data, new FileMetadata()); task.addOnCompleteListener(new MyOnCompleteListener("NormalListener")) .addOnCompleteListener(new Activity(), new MyOnCompleteListener("ActivityListener")) .addOnCompleteListener(new MyExecutor("ExecutorListener"), new MyOnCompleteListener("ExecutorListener")); MyOnCompleteListener remove = new MyOnCompleteListener("remove"); task.addOnCompleteListener(remove); task.removeOnCompleteListener(remove); Debug.Log("task.isComplete status: " + task.isComplete()); Debug.Log("UploadTask addOnCompleteListenerTest success"); }
public void addOnCompleteListenerTest() { Debug.Log("DownloadTask addOnCompleteListenerTest"); StorageReference reference = mAGCStorageManagement.getStorageReference(storageFileName); string downloadFilePath = downloadFileFolder + "addOnCompleteListenerTest.cpp"; File file = new File(downloadFilePath); DownloadTask task = reference.getFile(file); task.addOnCompleteListener(new MyOnCompleteListener("NormalListener")) .addOnCompleteListener(new Activity(), new MyOnCompleteListener("ActivityListener")) .addOnCompleteListener(new MyExecutor("ExecutorListener"), new MyOnCompleteListener("ExecutorListener")); MyOnCompleteListener remove = new MyOnCompleteListener("remove"); task.addOnCompleteListener(remove); task.removeOnCompleteListener(remove); Debug.Log("task.isComplete status: " + task.isComplete()); Debug.Log("DownloadTask addOnCompleteListenerTest success"); }