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);