Code example for ConcurrentHashMap

Methods: isEmpty, remove

0
        } 
 
        @Override 
        public void cancelNotification(int id) {
            mNM.cancel(id);
            mNotifications.remove(id);
            // If there are no more notifications 
            // (and nothing else to process in the thread queue?) 
            // stop the service. 
            if (mNotifications.isEmpty()) {
                //Log.d(TAG, "Stopping service"); 
                stopSelf();
            } 
        } 
 
        @Override 
        public Notification getNotification(int id) {
            return mNotifications.get(id);
        } 
 
    }