When we created the POIApp
project, a default layout and activity was created for us. Rather than deleting these, let's give them more appropriate names and remove unnecessary content as follows:
Select
main.axml
in Resources | Layout.Right-click on it, select Rename, and enter the name as
POIList.axml
.Double-click on it to open
POIList.axml
.Click on the Hello World button and then click on the the Delete button.
Select
MainActivity.cs
and rename it asPOIListActivity.cs
.Double-click on it to open
POILIstActivity.cs
.Rename the class inside as
POIListActivity
.Change the layout ID referenced in the
SetContentView()
API call toResources.Layout.POIList
.Remove the code related to the Hello World button that we removed from the layout. Your class should now look like the following code:
[Activity (Label = "POIs", MainLauncher = true)] public class POIListActivity : Activity { protected override void OnCreate (Bundle bundle) { base.OnCreate (bundle); ...