Exam AND-401 All QuestionsBrowse all questions from this exam
Question 49

What does the following code achieve?

Intent intent = new Intent(FirstActivity.this, SecondActivity.class); startActivityForResult(intent);

    Correct Answer: B

    The code snippet creates an Intent to switch from FirstActivity to SecondActivity and calls startActivityForResult to start the SecondActivity. This implies that the FirstActivity expects a result back from the SecondActivity after it finishes. Hence, it starts a sub-activity that can return a result.

Discussion
MmadiOption: B

B. Starts a sub-activity