Android Application Development (AND-401) — Question 67

Which of the following lines of code starts activity Activity2 from a current activity Activity1?

Answer options

Correct answer: D

Explanation

The correct answer is D because it correctly creates an Intent using the current context and the class of Activity2. Option A incorrectly tries to instantiate Activity2 directly, while B does not provide the current context. Option C incorrectly uses the class references for both activities, which is not the standard way to start an activity.