fixed nullPointerException and removed current downloading text from contentText

This commit is contained in:
Chumva 2018-02-23 18:03:47 +02:00
parent 05b48e899d
commit f29ace4544

View file

@ -123,10 +123,18 @@ public class DownloadIndexesThread {
if (contentText.length() > 0) { if (contentText.length() > 0) {
contentText.append(", "); contentText.append(", ");
} }
if (i == currentDownloadingItem) {
continue;
}
contentText.append(i.getVisibleName(app, app.getRegions())); contentText.append(i.getVisibleName(app, app.getRegions()));
if (i.getType() != null) {
contentText.append(" ").append(i.getType().getString(app)); contentText.append(" ").append(i.getType().getString(app));
} }
bld.setContentTitle(msg+" "+currentDownloadingItem.getType().getString(app)).setSmallIcon(android.R.drawable.stat_sys_download) }
if (currentDownloadingItem != null) {
msg += " " + currentDownloadingItem.getType().getString(app);
}
bld.setContentTitle(msg).setSmallIcon(android.R.drawable.stat_sys_download)
.setVisibility(NotificationCompat.VISIBILITY_PUBLIC) .setVisibility(NotificationCompat.VISIBILITY_PUBLIC)
.setContentText(contentText.toString()) .setContentText(contentText.toString())
.setContentIntent(contentPendingIntent).setOngoing(true); .setContentIntent(contentPendingIntent).setOngoing(true);