Skip to content

Instantly share code, notes, and snippets.

@saket
Created January 10, 2015 17:15
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 saket/29d0871e2c1ed4b86140 to your computer and use it in GitHub Desktop.
Save saket/29d0871e2c1ed4b86140 to your computer and use it in GitHub Desktop.
void showFirstNotif(){
mNotifBuilder.setContentTitle("First")
.setContentText("Body")
.setWhen(activityStartTime)
.setSmallIcon(PhotoUtils.getAppIconResId())
.setDefaults(Notification.DEFAULT_ALL)
.setOnlyAlertOnce(true);
NotificationManagerCompat.from(this).notify("Test", NOTIF_ID, mNotifBuilder.build());
}
void showSecondNotif(){
mNotifBuilder.setContentTitle("Second");
final Notification notif = mNotifBuilder.build();
notif.defaults = 0;
NotificationManagerCompat.from(this).notify("Test", NOTIF_ID, mNotifBuilder.build());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment