Code example for AndroidRuntimeException

0
		Notification notification = mManagedNotifications.get(id);
		if (notification == null) {
			notification = onCreateNotification(id);
			mManagedNotifications.put(id, notification);
			if (notification == null) {
				throw new AndroidRuntimeException(
						"Are you sure create notification in onCreateNotification which id is :" 
								+ id + "?");
			} 
		} 
		onPrepareNotification(id, notification);
		notificationManager.notify(id, notification);
	} 
 
	public void cancelNotification(int id) {
		ensureNotificationManager(); 
		Notification notification=null;
		if (mManagedNotifications != null) {
			notification = mManagedNotifications.get(id);
		} 
		if (notification == null) {