160k views
0 votes
Assume you have the following constant value, a NotificationManager object named manager, and a Notification object named notification. Which of the following statements removes the notification? final int NOTIFICATION_ID = 999;

User Ikarus
by
7.9k points

1 Answer

3 votes

Final answer:

To remove a notification in Android, call the 'cancel' method on the Notification Manager with the notification's ID.

Step-by-step explanation:

To remove the notification with ID NOTIFICATION_ID using the Notification Manager object named manager, you would call the cancel method on the manager with the ID as its argument. The code statement for this action would be manager.cancel(NOTIFICATION_ID);

The correct statement to remove the notification is:

manager.cancel(NOTIFICATION_ID);

By calling the cancel() method on the manager object with the NOTIFICATION_ID constant value as the argument, the notification will be removed.

User Swati Kiran
by
6.9k points