Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
Created attachment 16571 [details]
Screen which is shown during the loading startup, before reaching the Forms Page
My MainActivity-ActivityLine looks like this:
Theme = "@style/RebuyTheme",
Label = "@string/app_name",
LaunchMode = LaunchMode.SingleInstance,
ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation
The LaunchMode = LaunchMode.SingleInstance adds an empty view with a navigationBar.
When I remove that line, it's fine.
But I need the singleInstance.
What I have to do, that the Activity is not shown like this. I only want to show the splashscreen (which is perfectly shown) and than directly the normal Forms page
The MainActivity inherits from FormsApplicationActivity
Is there a reason you need to use SingleInstance here? SingleInstance is very rarely used and doesn't serve a benefit ontop of using Xamarin.Forms(That I've seen). Ideally only a single instance of an Activity can exist if this mode is enabled.
However with that said, it might be worth your time to read about Tasks in Android in general to understand how this works:
Given that you have a SplashActivity, you most likely want to decorate the "NoHistory = true" to ensure that you cannot go back to the SplashActivity and that Android forgets about it.
So applying this to your MainActivity, effectively when the MainActivity will launch from the intent that your SplashActivity gives, it is saying "Create a new task for this and make this Activity the root. If we do anything else with this, it will become a new separate task." So with that said, it should still behave in the fashion you're expecting. Splash Screen -> Main Activity. The difference will be in the Task Manager in seeing only one Task with your one Activity.
What you are probably seeing is the new Activity being created as the root and then the respective content being swapped into it. Thus you see in order:
Splash Screen -> Main Activity (With the Titlebar label) -> Main Activity with content swapped
You can debug this yourself by putting a breakpoint on the:
Line of code which will show the new Task with the single Activity created and then after this gets initialized and loaded it will swap the content in.
In short, you can't really do anything about this behavior with singleInstance. Best thing you could do is inflate a view(progress bar/etc) while the Forms init is being called.
Changed it to SingleTask. Right now it does what I expected what it should do. So thank you for your help.
Hi, I've the same problem with my solution, but I haven´t any LaunchMode in my Activity, but when I run my app, started the Splash, and the empty view showed up for a moment and after appears my MainActivity.
My questions is how can I chance that, because I don´t want to show this empty view between the splash and my MainActivity