Creating POIDetailActivity
Now that we have the POIDetail
layout ready, we need a corresponding activity. Perform the following steps to create a new activity for the POI details:
With the
POIApp
project selected in the Solution pad, right-click on it and navigate to Add | New File.In the New File dialog, click on Android and select Activity, enter
POIDetailActivity
as Name, and click on New.
As you may recall from Chapter 3, Creating the Points Of Interest App, one of the first things that needs to be done when an activity is created is to set the layout content, which is accomplished by calling SetContentView(layoutId)
. Add the following line of code to the OnCreate()
method of the POIDetailActivity
:
SetContentView (Resource.Layout.POIDetail);