I solved the Error problem mentioned in the video (minuet 38:22)
To solve the error problem mentioned in the video you need to to set the MainActivity LaunchMode to SingleTop like this:
[Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, LaunchMode = LaunchMode.SingleTop, ConfigurationChanges =........
This will eliminate the error.
Then to handle the data when the application is already running you need to add the following:
1- Check if data is added to preferences in OnAppearing() event of MainPage by overriding the method, because the constructor will not be called if there is already an instance of the page.
2- Add the data to the preferences in the OnNewIntent() event of MainActivity by overriding the method in MainActivity because OnCreate will not be called if the application is already running.
I solved the Error problem mentioned in the video (minuet 38:22) To solve the error problem mentioned in the video you need to to set the MainActivity LaunchMode to SingleTop like this: [Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, LaunchMode = LaunchMode.SingleTop, ConfigurationChanges =........ This will eliminate the error.
Then to handle the data when the application is already running you need to add the following: 1- Check if data is added to preferences in OnAppearing() event of MainPage by overriding the method, because the constructor will not be called if there is already an instance of the page.
2- Add the data to the preferences in the OnNewIntent() event of MainActivity by overriding the method in MainActivity because OnCreate will not be called if the application is already running.
Hope this will be helpful to everyone