MCQs / Computer Science / Intents and Notifications
Intents and Notifications MCQs — Computer Science (page 2) 38 multiple-choice questions on Intents and Notifications from Computer Science, each with the correct answer and, where available, a teacher's explanation. Read through them to revise the chapter, then practise the same questions one by one to test yourself.
26. Sharing plain text with any app uses: ACTIONDIAL with tel: ACTIONSEND with type "text/plain" and EXTRATEXT ACTIONVIEW with geo: ACTIONMAIN with LAUNCHER Answer: B) ACTIONSEND with type "text/plain" and EXTRATEXT
Explanation: ACTIONSEND is the standard share action.
Discuss this question
27. A notification is shown: Outside the app's UI, e.g. in the status bar and notification drawer Only in Logcat Only inside the app's activity Only on a desktop Answer: A) Outside the app's UI, e.g. in the status bar and notification drawer
Explanation: Notifications appear in system UI areas.
Discuss this question
28. ACTIONCALL (calling directly) requires which permission? No permission INTERNET READCONTACTS CALLPHONE Answer: D) CALLPHONE
Explanation: Placing a call directly is dangerous and needs CALLPHONE at run time.
Discuss this question
29. From Android 13, an app must request which runtime permission to show notifications? SHOWALERTS NOTIFYUSER STATUSBAR POSTNOTIFICATIONS Answer: D) POSTNOTIFICATIONS
Explanation: POSTNOTIFICATIONS is a runtime permission on API 33+.
Discuss this question
30. Posting a new notification with the same ID as an existing one will: Crash the app Delete all notifications Create a duplicate Update the existing notification Answer: D) Update the existing notification
Explanation: Same ID replaces/updates the notification.
Discuss this question
31. Extra data is attached to an intent as a: Fragment Cursor JSON file Bundle of key–value pairs (extras) Answer: D) Bundle of key–value pairs (extras)
Explanation: putExtra stores values in the intent's extras Bundle.
Discuss this question
32. An Intent in Android is a: Database query Layout file Messaging object used to request an action from another component Type of thread Answer: C) Messaging object used to request an action from another component
Explanation: Intents carry requests between components and apps.
Discuss this question
33. Notifications sent from a server to many phones use: Firebase Cloud Messaging (push notifications) Toasts Intent filters SharedPreferences Answer: A) Firebase Cloud Messaging (push notifications)
Explanation: FCM delivers push messages to Android devices.
Discuss this question
34. Which method actually displays the notification? notify(id, notification) build() show() post() Answer: A) notify(id, notification)
Explanation: NotificationManager(Compat).notify posts the notification.
Discuss this question
35. setAutoCancel(true) means: The notification is removed when the user taps it The notification can never be removed It disables sound It cancels the app Answer: A) The notification is removed when the user taps it
Explanation: Auto-cancel dismisses the notification on tap.
Discuss this question
36. Which action opens the dialer with a number but does NOT place the call? ACTIONANSWER ACTIONCALL ACTIONDIAL ACTIONSEND Answer: C) ACTIONDIAL
Explanation: ACTIONDIAL shows the dialer; the user presses call.
Discuss this question
37. Which extra holds the subject when composing an email? EXTRATITLE EXTRAHEADER EXTRAEMAILSUBJECTTEXT EXTRASUBJECT Answer: D) EXTRASUBJECT
Explanation: Intent.EXTRASUBJECT is the subject line.
Discuss this question
38. To make your app appear in the share sheet for text, its filter needs: action DIAL and scheme tel action MAIN and category LAUNCHER action SEND, category DEFAULT and mimeType text/plain action VIEW and scheme geo Answer: C) action SEND, category DEFAULT and mimeType text/plain
Explanation: This filter matches text share intents.
Discuss this question
Previous Page 2 of 2
Practise Intents and Notifications MCQs
More Computer Science chapters