Android
AND-401 · Question #87
Which of the following lines of code starts activity Activity2 from a current activity Activity1?
The correct answer is D. Intent intent = new Intent(this,Activity2.class). See the full explanation below for the reasoning.
Question
Which of the following lines of code starts activity Activity2 from a current activity Activity1?
Options
- AIntent intent = new Intent(this,new Activity2());
- BIntent intent = new Intent(new Activity2());
- CIntent intent = new Intent (Activity1.class,Activity2.class);
- DIntent intent = new Intent(this,Activity2.class);
How the community answered
(32 responses)- A3% (1)
- B9% (3)
- C3% (1)
- D84% (27)
Community Discussion
No community discussion yet for this question.