3
votes

I am developing one sample login application using xamarin forms, I developed code in common portable project. When running in Xamarin forms android project, this error is displayed:

Android.Util.AndroidRuntimeException: requestFeature() must be called before adding content

The code is:

public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsApplicationActivity
{
    protected override void OnCreate (Bundle bundle)
    {
        base.OnCreate (bundle);

        global::Xamarin.Forms.Forms.Init (this, bundle);

        LoadApplication (new App());
    }
}

enter image description here

How can I overcome this?

1

1 Answers

0
votes

inherit your MainActivity from FormsAppCompatActivity instead of FormsApplicationActivity

https://github.com/xamarin/Xamarin.Forms/issues/13779