Skip to content

Instantly share code, notes, and snippets.

Embed
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.")
.setSmallIcon(R.drawable.ic_notify_status);
// 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);
mNotificationManager.notify(
notifyID, mNotifyBuilder.build());
}
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.