Android download notification icon displays correctly on 5.0 and above

This commit is contained in:
mhutti1 2016-07-05 15:46:21 +01:00
parent c731ce0f5f
commit 88d4a2e799
14 changed files with 3 additions and 1 deletions

BIN
kiwix_notification-web.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 659 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 625 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 417 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 416 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 713 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 890 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 866 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -4,6 +4,7 @@ import android.app.NotificationManager;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.os.Environment;
import android.os.IBinder;
import android.support.annotation.Nullable;
@ -44,7 +45,8 @@ public class DownloadService extends Service {
notification = new NotificationCompat.Builder(this)
.setContentTitle("Download Zim")
.setProgress(100, 0, false)
.setSmallIcon(R.mipmap.kiwix_icon)
.setSmallIcon(R.drawable.kiwix_notification)
.setColor(Color.BLACK)
.setOngoing(true);
startForeground(DownloadIntent.DOWNLOAD_NOTIFICATION_ID, notification.build());