Skip to content

Instantly share code, notes, and snippets.

@karthiks
Last active August 24, 2017 18:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save karthiks/d4239fc6aba6f0c58505ea2f3a7b4249 to your computer and use it in GitHub Desktop.
Save karthiks/d4239fc6aba6f0c58505ea2f3a7b4249 to your computer and use it in GitHub Desktop.
Create NotificationManager from SystemService
public class NotificationUtils extends ContextWrapper {
private NotificationManager notificationManager;
public NotificationManager getNotificationManager() {
if (notificationManager == null) {
notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
}
return notificationManager;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment