Use ContextCompat.getSystemService() and the Context.getSystemService() extension function.
This commit is contained in:
parent
f4620be859
commit
58b720b004
17 changed files with 61 additions and 43 deletions
|
|
@ -234,8 +234,7 @@ public class App extends Application {
|
|||
final NotificationChannel mChannel = new NotificationChannel(id, name, importance);
|
||||
mChannel.setDescription(description);
|
||||
|
||||
final NotificationManager mNotificationManager =
|
||||
(NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
final NotificationManager mNotificationManager = getSystemService(NotificationManager.class);
|
||||
mNotificationManager.createNotificationChannel(mChannel);
|
||||
|
||||
setUpUpdateNotificationChannel(importance);
|
||||
|
|
@ -260,7 +259,7 @@ public class App extends Application {
|
|||
appUpdateChannel.setDescription(appUpdateDescription);
|
||||
|
||||
final NotificationManager appUpdateNotificationManager
|
||||
= (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
= getSystemService(NotificationManager.class);
|
||||
appUpdateNotificationManager.createNotificationChannel(appUpdateChannel);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue