修正未判断下载服务获取DownloadInfo为空的错误

This commit is contained in:
seven332 committed 2014-03-25 13:11:59 +08:00
1 parent 7945b0facd
commit 366285f625
12 files changed
+18 -8

No files matched your search

BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

BIN
View File
Binary file not shown.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

After

Width:  |  Height:  |  Size: 7.0 KiB

@@ -63,21 +63,31 @@ public class DownloadService extends Service {
@Override
public void onDownloadMangaStart(String id) {
mBuilder.setContentTitle(getString(R.string.downloading)
+ " " + Download.get(id).title)
DownloadInfo di = Download.get(id);
if (di == null)
mNotifyManager.cancel(DOWNLOAD_NOTIFY_ID);
else {
mBuilder.setContentTitle(getString(R.string.downloading)
+ " " + di.title)
.setContentText(null)
.setProgress(0, 0, true).setOngoing(true).setAutoCancel(false);;
mNotifyManager.notify(DOWNLOAD_NOTIFY_ID, mBuilder.build());
}
}
@Override
public void onDownloadMangaStart(String id, int pageSum, int startIndex) {
mBuilder.setContentTitle(getString(R.string.downloading)
+ " " + Download.get(id).title)
.setContentText(startIndex + " / " + pageSum)
.setProgress(pageSum, startIndex, false).setOngoing(true)
.setAutoCancel(false);
mNotifyManager.notify(DOWNLOAD_NOTIFY_ID, mBuilder.build());
DownloadInfo di = Download.get(id);
if (di == null)
mNotifyManager.cancel(DOWNLOAD_NOTIFY_ID);
else {
mBuilder.setContentTitle(getString(R.string.downloading)
+ " " + di.title)
.setContentText(startIndex + " / " + pageSum)
.setProgress(pageSum, startIndex, false).setOngoing(true)
.setAutoCancel(false);
mNotifyManager.notify(DOWNLOAD_NOTIFY_ID, mBuilder.build());
}
}
@Override