Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Notification whose content is partially redacted on API 21 secure lockscreens
private Notification buildNotification() {
NotificationCompat.Builder builder = new NotificationCompat.Builder(context)
.setVisibility(NotificationCompat.VISIBILITY_PRIVATE) // default
.setStyle(new NotificationCompat.BigTextStyle().bigText(fullText))
// show all the above in public contexts
// only show actions when unlocked
builder.addAction(R.drawable.ic_action, context.getString(R.string.action), actionIntent);
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.