public class MainActivity : TabActivity
{
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
SetContentView(Resource.Layout.layout1);
Intent intent = new Intent().SetClass(this, typeof(Activity1));
spec = tabHost.NewTabSpec("首页").SetIndicator("首页").SetContent(intent);
tabHost.AddTab(spec);
}
}
public class Activity1 : AndroidActivity
{
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
Xamarin.Forms.Forms.Init(this, bundle);
SetPage(new MyFirstPage());
}
}
SetPage(new MyFirstPage()); Sentence report empty exception error。
But alone start Activity1. Is also possible