Question: =+In this case, you have to call the appropriate method to extract the name/value pair based on the type of data set. For the integer

=+In this case, you have to call the appropriate method to extract the name/value pair based on the type of data set. For the integer value, use the getIntExtra() method (the second argument is the default value in case no value is stored in the specified name):

//---get the data passed in using getIntExtra()---

Toast.makeText(this,Integer.toString(

getIntent().getIntExtra("age1", 0)), Toast.LENGTH_SHORT).show();

To retrieve the Bundle object, use the getExtras() method:

//---get the Bundle object passed in---

Bundle bundle = getIntent().getExtras();

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Implementing Programming Languages Questions!