完善下载

This commit is contained in:
lyy
2016-10-07 19:30:55 +08:00
parent cb9188423f
commit 9c2015c90b
23 changed files with 337 additions and 93 deletions

View File

@@ -103,7 +103,7 @@ public class SimpleTestActivity extends BaseActivity<ActivitySimpleBinding> {
String action = intent.getAction();
switch (action) {
case DownloadManager.ACTION_PRE:
DownloadEntity entity = intent.getParcelableExtra(DownloadManager.ACTION_PRE);
DownloadEntity entity = intent.getParcelableExtra(DownloadManager.ENTITY);
len = entity.getFileSize();
L.d(TAG, "download pre");
mUpdateHandler.obtainMessage(DOWNLOAD_PRE, len).sendToTarget();
@@ -117,7 +117,7 @@ public class SimpleTestActivity extends BaseActivity<ActivitySimpleBinding> {
mUpdateHandler.obtainMessage(DOWNLOAD_RESUME, location).sendToTarget();
break;
case DownloadManager.ACTION_RUNNING:
long current = intent.getLongExtra(DownloadManager.ACTION_RUNNING, 0);
long current = intent.getLongExtra(DownloadManager.CURRENT_LOCATION, 0);
if (len == 0) {
mPb.setProgress(0);
} else {