Receiving the data in POIDetailActivity
When we get to the OnCreate()
method of the POIDetailActivity
, we need to access the PointOfInterest
object sent from POIListActivity
. This object will be used to display the details of the selected POI. The following section will walk you through the process of retrieving the extra bundle metadata from Intent
.
Each activity has an Intent
property that contains the intent and the corresponding information that was passed while starting the activity. The Intent
class provides a number of methods to access any of the Extras
bundle data by providing the corresponding keys. Before we retrieve the data, we can confirm whether the value for the specified key is available by calling the HasExtra ("poi")
method. The HasExtra
method returns a boolean
value; if it returns false
, we can assume that we are creating a new POI; otherwise, we need to retrieve the value of the extra.
The Intent
class has a series of GetXXExtra()
methods, where XX
represents the type...