3

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?

halfer
  • 19,824
  • 17
  • 99
  • 186
kumar Sudheer
  • 705
  • 3
  • 8
  • 28

1 Answers1

0

inherit your MainActivity from FormsAppCompatActivity instead of FormsApplicationActivity

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

root
  • 2,327
  • 1
  • 22
  • 18