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
Get step-by-step solutions from verified subject matter experts
