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

What does this code do?

Intent intent = new Intent();

intent.setAction(Intent.ACTION_VIEW);

intent.setData(android.net.Uri.parse("http://www.androidatc.com")); startActivity(intent);

    Correct Answer: D

    The given code creates an intent, sets its action to view a specified URL, and starts an activity using this intent. This is an example of using an implicit intent because the action and data are specified, but the target activity is not explicitly named. Implicit intents allow Android to determine the most appropriate application to handle the intent.

Discussion
MmadiOption: D

D. Starts an activity using an implicit intent.