Notification without “heads up”

大城市里の小女人 提交于 2019-12-06 08:43:10

If you insist on using PRIORITY_MAX, you can disable the Heads-Up notification using the following code starting with API 21:

notification.headsUpContentView = new RemoteViews(Parcel.obtain());

Displaying a heads up notification is a part of the definition of a high-priority notification:

If a notification's priority is flagged as High, Max, or full-screen, it gets a heads-up notification.

If you don't want a heads-up notification, you do not want a high-priority notification.

Note that you users can opt to disable heads up notifications or lower the priority of your notifications themselves, but this is an option solely for the user.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!