Fix notification large icon

This commit is contained in:
seven332 committed 2016-02-26 19:32:01 +08:00
1 parent 5ce6c4cf66
commit 7b604146f1
1 file changed
+2 -7
@@ -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<String> 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)