From 7b604146f1a115de5d1f39066e7dbc0d57ec1d3e Mon Sep 17 00:00:00 2001 From: seven332 Date: Fri, 26 Feb 2016 19:32:01 +0800 Subject: [PATCH] Fix notification large icon --- .../com/hippo/ehviewer/download/DownloadService.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/com/hippo/ehviewer/download/DownloadService.java b/app/src/main/java/com/hippo/ehviewer/download/DownloadService.java index afe49aecd..ec328c63c 100644 --- a/app/src/main/java/com/hippo/ehviewer/download/DownloadService.java +++ b/app/src/main/java/com/hippo/ehviewer/download/DownloadService.java @@ -21,7 +21,6 @@ import android.app.PendingIntent; import android.app.Service; import android.content.Context; import android.content.Intent; -import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.os.IBinder; import android.support.annotation.Nullable; @@ -71,8 +70,6 @@ public class DownloadService extends Service implements DownloadManager.Download private int mFinishedCount; private int mDownloadedCount; - private Bitmap mLargeIcon; - public void init(SparseBooleanArray stateArray, SparseArray titleArray, int failedCount, int finishedCount, int downloadedCount) { mItemStateArray = stateArray; @@ -80,7 +77,6 @@ public class DownloadService extends Service implements DownloadManager.Download mFailedCount = failedCount; mFinishedCount = finishedCount; mDownloadedCount = downloadedCount; - mLargeIcon = BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher); } public void clear() { @@ -93,7 +89,6 @@ public class DownloadService extends Service implements DownloadManager.Download if (mItemTitleArray != null) { mItemTitleArray.clear(); } - mLargeIcon = null; } @Override @@ -196,7 +191,7 @@ public class DownloadService extends Service implements DownloadManager.Download PendingIntent piClear = PendingIntent.getService(this, 0, clearIntent, 0); mDownloadedBuilder = new NotificationCompat.Builder(getApplicationContext()) .setSmallIcon(android.R.drawable.stat_sys_download_done) - .setLargeIcon(mLargeIcon) + .setLargeIcon(BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher)) .setContentTitle(getString(R.string.stat_download_done_title)) .setDeleteIntent(piClear) .setOngoing(false) @@ -210,7 +205,7 @@ public class DownloadService extends Service implements DownloadManager.Download m509dBuilder = new NotificationCompat.Builder(getApplicationContext()) .setSmallIcon(R.drawable.ic_stat_alert) - .setLargeIcon(mLargeIcon) + .setLargeIcon(BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher)) .setContentText(getString(R.string.stat_509_alert_title)) .setContentText(getString(R.string.stat_509_alert_text)) .setAutoCancel(true)