Android Notification intent to clear it self

前端 未结 6 1437
旧巷少年郎
旧巷少年郎 2020-12-09 08:25

I have read many examples of how to create notification messages. What i wanted to achieve, is because the notification will be executed by a widget, i would like the notifi

6条回答
  •  既然无缘
    2020-12-09 08:59

    The only way I can see of doing this is to have your Notification's Intent point to a background Service. When this Service is launched, it would clear the given Notification using NotificationManager.cancel(int id). The Service would then stop itself. It's not pretty, and would not be easy to implement, but I can't find any other way of doing it.

提交回复
热议问题