Android Application Development (AND-401) — Question 90

Which of the following lines of code is used to pass a value to the next activity?

Answer options

Correct answer: D

Explanation

The correct answer is D because the method `putExtra` is specifically designed to send additional data to the next activity. Options A, B, and C use incorrect methods (`addExtra` and `putValue`), which do not exist in the Intent class, making them invalid for passing values.