Pin Notification to top of notification area

前端 未结 8 1785
有刺的猬
有刺的猬 2020-12-09 05:35

I have a Notification which is refreshed (i.e. sent) every three seconds. I\'ve set the FLAG_ONGOING_EVENT flag and the FLAG_NO_CLEAR flag so that is always shown. The probl

8条回答
  •  孤街浪徒
    2020-12-09 05:50

    It's been some time since I've done code for Android, but if I remember correctly, whenever you call NotificationManager.notify(), it's because you want to alert the user by having an icon move or flash. However, there are ways of modifying the actual notifications you're sending.

    You can also call .cancel() on it if that helps.

    Here's the Android API documentation for help, although you've probably already seen them:

    Notification

    NotificationManager

    Hope that helped!

提交回复
热议问题