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

What does the following line of code achieve?

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

    Correct Answer: C

    The line of code in question 'Intent intent = new Intent(FirstActivity.this, SecondActivity.class);' creates an explicit intent. An explicit intent specifies the exact component inside the app that should be launched. In this case, it indicates that the activity 'SecondActivity' should be launched from 'FirstActivity'. Options C and D are indeed identical, so either would be correct.

Discussion
sim9Option: C

Both C and D options are same

MmadiOption: C

D. Create an explicit Intent