Stuck in splash screen

My Xamarin Forms App works fine in IOS devices, but when trying to deploy on an Android device or simulator is stuck on the splash screen.

Answers

  • HarshitaHarshita INMember ✭✭✭✭

    @mhdmaktabi
    can your show me your splashscreen activity OnCreate method?

  • mhdmaktabimhdmaktabi Member ✭✭

    @Harshita
    This is my splashscreen activity OnCreate:

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
    
            if (Build.VERSION.SdkInt >= BuildVersionCodes.Lollipop)
            {
                Window.DecorView.SystemUiVisibility = StatusBarVisibility.Visible;
                Window.SetStatusBarColor(Android.Graphics.Color.Transparent);
            }
    
            InvokeMainActivity();
        }
    
        void InvokeMainActivity()
        {
            var mainActivityIntent = new Intent(this, typeof(MainActivity));
            StartActivity(mainActivityIntent);
        }
    
  • HarshitaHarshita INMember ✭✭✭✭

    @mhdmaktabi
    And your MainActivity OnCreate Method?

  • mhdmaktabimhdmaktabi Member ✭✭

    @Harshita
    This is my MainActivity OnCreate Method:

    protected override void OnCreate(Bundle bundle)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource = Resource.Layout.Toolbar;
    
            base.OnCreate(bundle);
    
            Forms.Init(this, bundle);
            CarouselViewRenderer.Init();
            Renderers.Calendar.Init();
            Xamarin.FormsMaps.Init(this, bundle);
            Xamarin.Essentials.Platform.Init(this, bundle);
            FFImageLoading.Forms.Platform.CachedImageRenderer.Init(false);
            Popup.Init(this, bundle);
            Acr.UserDialogs.UserDialogs.Init(this);
    
            InitMessageCenterSubscriptions();
            RegisterPlatformDependencies();
            LoadApplication(new App());
    
            App.AuthenticationClient.PlatformParameters = new PlatformParameters(this);
    
            MakeStatusBarTranslucent(false);
            InitNFCService();
        }
    
  • HarshitaHarshita INMember ✭✭✭✭

    @mhdmaktabi
    It should be work :(
    do you ever debug this step by step.Set a break point to App.xaml.cs page constructor and see what happen.

  • jezhjezh Member, Xamarin Team Xamurai

    Yes, you should debug your code step by step to see when and where this problem happen (the construct of App.xaml.cs and the OnCreate() method of splashscreen activity)

Sign In or Register to comment.