Skip to content

Commit 4fd4d9a

Browse files
Guard update notifications on Oreo
1 parent 9c50de9 commit 4fd4d9a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/src/main/java/com/d4rk/androidtutorials/java/ui/screens/main/MainActivity.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,9 @@ protected void onResume() {
312312
super.onResume();
313313
AppUsageNotificationsManager appUsageNotificationsManager = new AppUsageNotificationsManager(this);
314314
appUsageNotificationsManager.scheduleAppUsageCheck();
315-
appUpdateNotificationsManager.checkAndSendUpdateNotification();
315+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
316+
appUpdateNotificationsManager.checkAndSendUpdateNotification();
317+
}
316318
checkForFlexibleOrImmediateUpdate();
317319
}
318320

0 commit comments

Comments
 (0)