Skip to content

Commit

Permalink
opt
Browse files Browse the repository at this point in the history
  • Loading branch information
heaven7 committed Aug 11, 2020
1 parent a78c376 commit 7d61037
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,17 @@ private boolean query0(long id, Integer downloadFlags, DownloadTask task){
task.setLastModifyTime(lastModifyTime);
task.setReason(reason);
task.setStatus(status);
task.setLocalUri(Uri.parse(uriStr));
if(uriStr != null){
task.setLocalUri(Uri.parse(uriStr));
}
return true;
}else {
System.err.println("no download state for: " + task.getUrl());
}
}finally {
}catch (Exception e){
e.printStackTrace();
}
finally {
cursor.close();
}
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,18 @@ public void onQueryResult(Context context, DownloadTask task) {
case DownloadHelper.STATUS_FAILED:
onDownloadFailed(context, task);
break;

default:
System.err.println("download known error: " + task.getStatus());
onUnknownError(context, task);
break;
}
}

protected void onUnknownError(Context context, DownloadTask task) {

}

protected void onDownloadPending(Context context, DownloadTask task) {

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ protected void onCreate(Bundle savedInstanceState) {
}

public void onClickDownload(View view) {
String url = "https://d2.aoc5566.com//android2/20190325/360shoujizhushou_ali213.apk";
//String url = "https://d2.aoc5566.com//android2/20190325/360shoujizhushou_ali213.apk";
String url = "https://common-dev.oss-cn-beijing.aliyuncs.com/shipper-debug.apk";
DownloadTask task = new DownloadTask();
task.setUrl(url);
Downloader.getDownloadHelper().download(task, new SimpleDownloadCallback(Downloader.getDownloadHelper()) {
Expand Down

0 comments on commit 7d61037

Please sign in to comment.