Android Notification intent to clear it self

前端 未结 6 1445
旧巷少年郎
旧巷少年郎 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:55

     /** 
          Post a notification to be shown in the status bar. 
          Obs.: You must save this values somewhere or even pass it as an extra through Intent to use it later
     */
     notificationManager.notify(NOTIFICATION_ID, notification);
    
     /** 
          Cancel a previously shown notification given the notification id you've saved before
     */
     notificationmanager.cancel(NOTIFICATION_ID);
    

提交回复
热议问题