Закрыть уведомление Android

У меня есть уведомление при запуске службы, но я не знаю, как закрыть это уведомление при остановке службы или при ее уничтожении. есть идеи.

следующий код, который запускает уведомление при запуске службы.

String ns = Context.NOTIFICATION_SERVICE;
    final int KEEPUS_NOTIFICATION_ID = 1;
    NotificationManager mNotificationManager = (NotificationManager) context.getSystemService(ns);
    Notification notification = new Notification(R.drawable.notification_icon1, ticker_text, System.currentTimeMillis());
    Intent notificationIntent = new Intent(context, KeepusActivity.class);
    PendingIntent contentIntent = PendingIntent.getActivity(context, 0, notificationIntent, 0);
    notification.setLatestEventInfo(context, ticker_content_title, ticker_content_text,contentIntent);
    mNotificationManager.notify(KEEPUS_NOTIFICATION_ID, notification);
6
задан Suresh Kerai 30 June 2011 в 10:25
поделиться