Android Application Development (AND-401) — Question 74
If your application is throwing exception android.content.ActivityNotFoundException, which of the following could resolve the problem?
Answer options
- A. Create a new sub-class of the View class.
- B. Create a new broadcast receiver
- C. Create the activity layout
- D. Add the activity to the AndroidManifest.xml
Correct answer: D
Explanation
The correct answer is D because the android.content.ActivityNotFoundException indicates that the application is trying to start an activity that is not declared in the AndroidManifest.xml file. Options A, B, and C do not address the root cause of the exception, which is the missing activity declaration.