Skip to content

Instantly share code, notes, and snippets.

@karthiks
Last active August 24, 2017 18:52
Show Gist options
  • Select an option

  • Save karthiks/d4239fc6aba6f0c58505ea2f3a7b4249 to your computer and use it in GitHub Desktop.

Select an option

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