public static void clearAllNotifications(Context context) { NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); notificationManager.cancelAll(); }
public static void clearAllNotifications(Context context) { NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); notificationManager.cancelAll(); }
public static void clearAllNotifications(Context context) { NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); notificationManager.cancelAll(); }
public static void clearAllNotifications(Context context) { NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); notificationManager.cancelAll(); }
public static void clearAllNotifications(Context context) { NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); notificationManager.cancelAll(); }
public static void clearAllNotifications(Context context) { NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); notificationManager.cancelAll(); }
public static void clearAllNotifications(Context context) { NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); notificationManager.cancelAll(); }
@Override protected void onDestroy() { super.onDestroy(); if (downloadId != 0) { FileDownloader.getImpl().pause(downloadId); } notificationHelper.clear(); ((NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE)). cancelAll(); }
@Subscribe(threadMode=ThreadMode.MAIN) public void onBroadcast(Intent i) { if (i.getBooleanExtra(EXTRA_STOP, false)) { ((NotificationManager)getSystemService(NOTIFICATION_SERVICE)).cancelAll(); finish(); } else { int delta=i.getIntExtra(EXTRA_DELTA, 0); if (position+delta>=0 && position+delta<SlidesAdapter.SLIDES.length) { position+=delta; updateSlide(); } } }
/** * 根据id清除通知 */ public void clear() { // 取消通知 nm.cancelAll(); } }
@Test public void testCancelAll() throws Exception { notificationManager.notify(1, notification1); notificationManager.notify(31, notification2); notificationManager.cancelAll(); assertEquals(0, shadowOf(notificationManager).size()); assertNull(shadowOf(notificationManager).getNotification(null, 1)); assertNull(shadowOf(notificationManager).getNotification(null, 31)); }
@Override protected void onResume(){ super.onResume(); notif_on = false; background = false; if(mNotificationManager!=null) mNotificationManager.cancelAll(); } @Override
@Override public int onStartCommand(@Nullable Intent intent, int flags, int startId) { Log.i(TAG, "onStartCommand" + intent); switch (intent == null ? Command.START : Command.values()[intent.getIntExtra("COMMAND", Command.START.ordinal())]) { case RESUME: NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); notificationManager.cancelAll(); // fallthrough case START: getSharedPreferences("state", MODE_PRIVATE).edit().putBoolean("isActive", true).apply(); startVpn(intent == null ? null : (PendingIntent) intent.getParcelableExtra("NOTIFICATION_INTENT")); break; case STOP: getSharedPreferences("state", MODE_PRIVATE).edit().putBoolean("isActive", false).apply(); stopVpn(); break; case PAUSE: pauseVpn(); break; } return Service.START_STICKY; }
notificationManager.cancelAll(); Api.updateNotification(Api.isEnabled(ctx), ctx); if(!enabled) { NotificationManager notificationManager = (NotificationManager) ctx.getSystemService(Context.NOTIFICATION_SERVICE); notificationManager.cancelAll(); } else { Api.updateNotification(Api.isEnabled(ctx), ctx);
@Override protected void onDestroy(){ notif_on = false; mNotificationManager.cancelAll(); CustomAction.save(); watchdogTask.cancel(true); stop(PROCESS_AIRODUMP); stop(PROCESS_AIREPLAY); stop(PROCESS_MDK_BF); stop(PROCESS_MDK_DOS); stop(PROCESS_AIRCRACK); stop(PROCESS_REAVER); runOne(disable_monMode); RootFile.finish(); Shell.exitAll(); stopService(new Intent(this, PersistenceService.class)); super.onDestroy(); System.exit(0); } @Override
public static void clearAllNotifications(Context context) { NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); notificationManager.cancelAll(); }
public static void cancelAllNotifications() { NotificationManager notificationManager = (NotificationManager) MyApplication.getContextOfApplication().getSystemService(Context.NOTIFICATION_SERVICE); notificationManager.cancelAll(); }
@Override public void onDestroy() { super.onDestroy(); notificationManager.cancelAll(); if (clipboardManager != null && onPrimaryClipChangedListener != null) { clipboardManager.removePrimaryClipChangedListener(onPrimaryClipChangedListener); } }
private void finishDownload() { RxBus.get().post(RxBusTag.FINISH_DOWNLOAD_LISTENER, new Object()); notifyManager.cancelAll(); new Handler(Looper.getMainLooper()).post(new Runnable() { @Override public void run() { Toast.makeText(getApplicationContext(), "全部离线章节下载完成", Toast.LENGTH_SHORT).show(); } }); }
@Override public void onReceive(Context context, Intent intent) { appendLog(context, TAG, "receive intent: ", intent); String notificationPresence = AppPreference.getNotificationPresence(context); if ("on_lock_screen".equals(notificationPresence)) { NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); notificationManager.cancelAll(); } } };