Which of the following lines of code is used to pass a value to the next activity?
Which of the following lines of code is used to pass a value to the next activity?
The correct line of code to pass a value to the next activity is: Intent i = new Intent(this,newActivity); i.putExtra("value1","test");. The putExtra method is used to add extended data to the intent that can be retrieved by the launched activity.
D. Intent i = new Intent(this,newActivity); i.putExtra("value1","test");