Cancel notification
问题 I use Onesignal to push notification and need to cancel all notification of onPause and onResume, NotificationManager notificationManager = (NotificationManager) getApplicationContext().getSystemService(Context.NOTIFICATION_SERVICE); if (notificationManager!=null) notificationManager.cancelAll(); but it's not work correctly. When app restarted I get all old notifications. I restard my app and these old notifications need to not showing. Please help to fix this!! 回答1: You need to use this