Creating POIListActivity
When we created the POIApp
solution, along with the default layout, a default activity (MainActivity.cs
) was created. Let's rename the MainActivity.cs
file to POIListActivity.cs
:
Select the
MainActivity.cs
file from Solution Explorer and rename toPOIListActivity.cs
.Open the
POIListActivity.cs
file in the code editor and rename the class toPOIListActivity
.The
POIListActivity
class currently contains the code that was created automatically while creating the solution using Xamarin Studio. We will write our own activity code, so let's remove all the code from thePOIListActivity
class.Override the
OnCreate()
activity life cycle callback method. This method will be used to attach the activity layout, instantiate the views, and write other activity initialization logic. Add the following code blocks to thePOIListActivity
class:namespace POIApp { [Activity (Label = "POIApp", MainLauncher = true, Icon = "@ drawable/icon")] public class POIListActivity : Activity {...