Android notification turn on banner setting programmatically

微笑、不失礼 提交于 2019-12-04 06:17:11

Same problem. I solved this issue simply adding in the AndroidManifest.xml the ACCESS_NOTIFICATION_POLICY permission:

<uses-permission android:name="android.permission.ACCESS_NOTIFICATION_POLICY" />

Nothing more is required (at least for me).

Usually for settings you need to get the user to permission, you can do this in your java class.

You can send the user to the settings so they can give you the permission that you want. However, it sounds to me that you are looking for heads-up notifications. If that is the case:

https://developer.android.com/guide/topics/ui/notifiers/notifications.html#Heads-up

In simple words, set a priority of high in your notification manager class.

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