use getNotification() as build() requires api level 16

This commit is contained in:
Adrian Ulrich 2017-02-20 18:57:23 +01:00
parent 36c21a46b2
commit 7580280ba5

View File

@ -237,6 +237,7 @@ public class MediaScanner implements Handler.Callback {
*/
private void updateNotification(boolean visible) {
MediaScanPlan.Statistics stats = mScanPlan.getStatistics();
MediaLibrary.Preferences prefs = MediaLibrary.getPreferences(mContext);
NotificationManager manager = (NotificationManager) mContext.getSystemService(mContext.NOTIFICATION_SERVICE);
if (visible) {
@ -248,11 +249,12 @@ public class MediaScanner implements Handler.Callback {
String content = stats.lastFile;
Notification notification = new Notification.Builder(mContext)
.setProgress(prefs._nativeLibraryCount, stats.seen, false)
.setContentTitle(title)
.setContentText(content)
.setSmallIcon(icon)
.setOngoing(true)
.build();
.getNotification(); // build() is API 16 :-/
manager.notify(NOTIFICATION_ID, notification);
}
} else {