Android Application Development (AND-401) — Question 84
To add a new Activity to your application, you need to perform the following steps:
Answer options
- A. Create a Java class that extends View, set a layout, and add an Activity tag in AndroidManifest.xml
- B. Create layout resource only.
- C. Create a Java class that extends Activity, add an Activity tag in AndroidManifest.xml, and create a layout for the activity.
- D. Add an Activity tag to AndroidManifest.xml, and add ACTIVITY permission.
Correct answer: C
Explanation
The correct answer is C because it outlines the necessary components for creating an Activity, including the Java class that must extend Activity, the Activity tag in the manifest, and the associated layout. Option A is incorrect as extending View instead of Activity is not suitable for an Activity. Option B is incomplete since it lacks the required Java class and manifest declaration. Option D incorrectly suggests that only the manifest tag and permission are needed without the Java class and layout creation.