diff --git a/注解使用.md b/注解使用.md index 4b64985..64f587e 100644 --- a/注解使用.md +++ b/注解使用.md @@ -20,6 +20,13 @@ 在上面的例子中,只有下载地址是`https://test.xx.apk`和`http://test.xx2.apk`才会触发 `taskRunning(DownloadTask task)`方法。 除了用注解判断任务外,你还可以使用`task.getKey()`来判断当前任务,`getKey()`返回的是下载地址或上传任务 +```java +@Download.onTaskRunning void taskRunning(DownloadTask task) { + if(task.getKey().eques(DOWNLOAD_URL)){ + mAdapter.setProgress(task.getDownloadEntity()); + } +} +``` ## HTTP\FTP单任务下载注解 | 注解 | 说明 | 示例 |