From a842f74c6fd7922d95d8ec7c3269779746f5f48c Mon Sep 17 00:00:00 2001 From: AriaLyy <511455842@qq.com> Date: Fri, 2 Dec 2016 19:24:11 +0800 Subject: [PATCH] e --- .../main/java/com/arialyy/downloadutil/core/AMTarget.java | 6 ++++++ .../src/main/java/com/arialyy/downloadutil/core/Aria.java | 7 ++++--- .../java/com/arialyy/downloadutil/core/AriaManager.java | 4 ++++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/downloadutil/src/main/java/com/arialyy/downloadutil/core/AMTarget.java b/downloadutil/src/main/java/com/arialyy/downloadutil/core/AMTarget.java index 5ef3b256..45e821f3 100644 --- a/downloadutil/src/main/java/com/arialyy/downloadutil/core/AMTarget.java +++ b/downloadutil/src/main/java/com/arialyy/downloadutil/core/AMTarget.java @@ -7,4 +7,10 @@ public class AMTarget { Context context; OnSchedulerListener listener; DownloadEntity entity; + + + //public DownloadManager load(DownloadEntity entity){ + // this.entity = entity; + //} + } \ No newline at end of file diff --git a/downloadutil/src/main/java/com/arialyy/downloadutil/core/Aria.java b/downloadutil/src/main/java/com/arialyy/downloadutil/core/Aria.java index cdbad75b..d5576bef 100644 --- a/downloadutil/src/main/java/com/arialyy/downloadutil/core/Aria.java +++ b/downloadutil/src/main/java/com/arialyy/downloadutil/core/Aria.java @@ -42,9 +42,10 @@ public class Aria { mDownloadManager = DownloadManager.init(context); } - //public static AriaManager whit(Context context) { - // return AriaManager.getInstance().get(context); - //} + public static AMTarget whit(Context context) { + AMTarget target = AriaManager.getInstance(context).get(context); + return target; + } /** * 开始下载 diff --git a/downloadutil/src/main/java/com/arialyy/downloadutil/core/AriaManager.java b/downloadutil/src/main/java/com/arialyy/downloadutil/core/AriaManager.java index 66d18291..41b53583 100644 --- a/downloadutil/src/main/java/com/arialyy/downloadutil/core/AriaManager.java +++ b/downloadutil/src/main/java/com/arialyy/downloadutil/core/AriaManager.java @@ -33,6 +33,10 @@ import java.util.Map; return INSTANCE; } + public AMTarget get(Context context){ + return getTarget(context); + } + private void putTarget(Context context) { String clsName = context.getClass().getName(); AMTarget target = mTargets.get(clsName);