Guest User

Untitled

a guest
Jan 19th, 2018
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. AlarmManager am=(AlarmManager)getSystemService(Context.ALARM_SERVICE);
  2. Intent intent = new Intent(Display.this, TwoAlarmService.class);
  3. PendingIntent pi = PendingIntent.getBroadcast(Display.this, AlarmNumber, intent, PendingIntent.FLAG_CANCEL_CURRENT);
  4. am.cancel(pi);
  5.  
  6. NotificationManager notificationManager = (NotificationManager) getApplicationContext().getSystemService(Context.NOTIFICATION_SERVICE);
  7. notificationManager.cancel(NOTIFICATION_ID);
  8.  
  9. notificationManager.cancelAll();
  10.  
  11. String ns = NOTIFICATION_SERVICE;
  12. NotificationManager nMgr = (NotificationManager) getActivity().getApplicationContext().getSystemService(ns);
  13. nMgr.cancel(NOTIFICATION_ID);
  14. }
Add Comment
Please, Sign In to add comment