单击我的页脚图标时如何从状态栏中删除通知
How to remove notification from status bar when clicking the my footer icon
我想删除单击页脚图标时状态栏中的通知。如何在服务外调用此方法 class:
mNotificationManager.cancel(MY_NOTIFICATION_ID);
是否有任何其他解决方案可以通过单击自定义按钮来删除通知?
您可以通过以下方式调用服务外的通知class(例如activity使用按钮点击):
NotificationManager mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
mNotificationManager.cancel(MY_NOTIFICATION_ID);
您可以在 https://developer.android.com/training/notify-user/build-notification#Removing 查看详细信息。
我想删除单击页脚图标时状态栏中的通知。如何在服务外调用此方法 class:
mNotificationManager.cancel(MY_NOTIFICATION_ID);
是否有任何其他解决方案可以通过单击自定义按钮来删除通知?
您可以通过以下方式调用服务外的通知class(例如activity使用按钮点击):
NotificationManager mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
mNotificationManager.cancel(MY_NOTIFICATION_ID);
您可以在 https://developer.android.com/training/notify-user/build-notification#Removing 查看详细信息。