nerdexam
Android

AND-401 · Question #90

What does this code do? Intent intent = new Intent(); intent.setAction(Intent.ACTION_VIEW); startActivity(intent);

The correct answer is D. Starts an activity using an implicit intent. See the full explanation below for the reasoning.

Question

What does this code do? Intent intent = new Intent(); intent.setAction(Intent.ACTION_VIEW); startActivity(intent);

Options

  • AStarts a sub-activity
  • BStarts a service
  • CSends results to another activity.
  • DStarts an activity using an implicit intent.

How the community answered

(45 responses)
  • A
    4% (2)
  • B
    7% (3)
  • C
    13% (6)
  • D
    76% (34)

Community Discussion

No community discussion yet for this question.

Full AND-401 Practice