
上QQ阅读APP看书,第一时间看更新
DoToo.Android
This is the Android app. It only has one file:

The important file here is MainActivity.cs. This contains the entry point for our application if we run the app on an Android device. The entry point method for an Android app is OnCreate(...).
If you open the MainActivity.cs and examine the OnCreate(...) method, it should look something like this:
protected override void OnCreate(Bundle bundle)
{
TabLayoutResource = Resource.Layout.Tabbar;
ToolbarResource = Resource.Layout.Toolbar;
base.OnCreate(bundle);
global::Xamarin.Forms.Forms.Init(this, bundle);
LoadApplication(new App());
}
The first two lines assign resources for the Tabbar and the Toolbar. We then call the base method, followed by the mandatory initialization of Xamarin.Forms. Finally, we have the call to load the Xamarin.Forms application that we have defined in the .NET Standard library.
We don't need to understand these files in detail, just remember that they are important for the initialization of our app.