Skip to content

Commit 8d65337

Browse files
author
Kevin Li
authored
Fix download notification doesn't dismiss issue. (#1176)
1 parent b97bb08 commit 8d65337

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

plugin-offline/src/main/java/com/mapbox/mapboxsdk/plugins/offline/offline/OfflineDownloadService.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,11 @@ void showNotification(final OfflineDownloadOptions offlineDownload) {
149149
getApplicationContext(), offlineDownload), offlineDownload.notificationOptions(),
150150
OfflineDownloadStateReceiver.createCancelIntent(getApplicationContext(), offlineDownload)
151151
);
152-
startForeground(offlineDownload.uuid().intValue(), notificationBuilder.build());
153-
152+
if (regionLongSparseArray.isEmpty()) {
153+
startForeground(offlineDownload.uuid().intValue(), notificationBuilder.build());
154+
} else {
155+
notificationManager.notify(offlineDownload.uuid().intValue(), notificationBuilder.build());
156+
}
154157
if (offlineDownload.notificationOptions().requestMapSnapshot()) {
155158
// create map bitmap to show as notification icon
156159
createMapSnapshot(offlineDownload.definition(), new MapSnapshotter.SnapshotReadyCallback() {

0 commit comments

Comments
 (0)