Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Display Notification with actions
public void displayNotificationWithActions() {
mNotifyBuilder = new NotificationCompat.Builder(this)
.setContentTitle("New Message")
.setContentText("You've received new messages.")
// Create Pending Intent that broadcasts an Intent
Intent intent = new Intent(context.getPackageName() + ".READ_MESSAGE");
PendingIntent pendingIntent =
PendingIntent.getActivity(this, 0, resultIntent, PendingIntent.FLAG_UPDATE_CURRENT);
mNotifyBuilder.addAction(R.drawable.ic_checkmark, "Read message", pendingIntent);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.