Shawn
Shawn

Reputation: 2735

Android Lollipop - How to make Notifications show on the Notification Drawer but not on the Status Bar?

On my HTC One M7, Android 5.0.2, HTC Sense 6.0, there are some notifications that are showing on the Notification Drawer, but not on the Status bar (and not on the Lock Screen). For example, Google Now weather info and Facebook Messenger "Chat heads active."

They can be ongoing or one-time.

I couldn't find any documentation on this. How do I create such notifications?

Upvotes: 0

Views: 729

Answers (2)

schmichri
schmichri

Reputation: 553

Using NotificationCompat.Builder:

mBuilder.setPriority(NotificationCompat.PRIORITY_MIN);

Upvotes: 0

ianhanniballake
ianhanniballake

Reputation: 199825

Use PRIORITY_MIN with setPriority() as explained in the notifications design guidelines:

MIN: Use for contextual or background information such as weather information or contextual location information. Minimum-priority notifications do not appear in the status bar. The user discovers them on expanding the notification shade.

Upvotes: 3

Related Questions