I have created a universal application with Xamarin Forms
I get the warning
Xamarin.Forms.Platform.Android.FormsApplicationActivity.SetPage(Xamarin.Forms.Page)' is obsolete
Has anyone come across this?
The code is shown below
public class MainActivity : AndroidActivity
{
protected override void OnCreate (Bundle bundle)
{
base.OnCreate (bundle);
Xamarin.Forms.Forms.Init (this, bundle);
SetPage (App.GetMainPage ());
}
}
Paul
Forms 1.3.1 supports a new Application class that has a MainPage property, which allows you to set the App start page in a single location (rather than once per platform).
public class App : Application // superclass new in 1.3
{
public App ()
{
// The root page of your application
MainPage = new ContentPage {...}; // property new in 1.3
}
A Migration Guide is available which outlines all of the changes you will need to make in your app for the new API.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With