Answer accepted by question author
handling it there must be performed by doing a navigation command after LoadApplication()
Do you want to display a different main page for the user? Try to perform the navigation in the shared project instead.
Pass a parameter when calling LoadApplication method.
protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);
Xamarin.Essentials.Platform.Init(this, savedInstanceState);
global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
LoadApplication(new App(parameter));
}
Then detect the value to show a different page.
public partial class App : Application
{
public App(bool parameter)
{
InitializeComponent();
if (parameter)
{
MainPage = new NavigationPage(new MainPage());
}
else
{
MainPage = new NavigationPage(new TestPage());
}
}
}
-
Adrian Jakubcik 121 Reputation points
Do you want to display a different main page for the user?
No, I'm trying to load the same MainPage, but as it loads up and the app was started up by tapping a local notification I would like it to navigate to a subpage.
I will try to do it by passing a parameter to theAppit's the only workaround for my situation as it seems.
@JarvanZhang Thanks for the support.
Sign in to comment
