Here is the work with the problem of the second page with Android. Create a second interface and instead of using the installed page in an existing activity, start a new activity in which OnCreate of the new action calls the given page and completes the current activity.
App.cs
public static ILoginManager LoginManager; public static IAppNavigation SplashManger; public static Page GetLoginPage(ILoginManager lmanager) { LoginManager = lmanager; return new Page_Login(); } public static Page GetShowSplashPage(IAppNavigation iSplashNavigation) { SplashManger = iSplashNavigation; return new Page_Splash(); }
Android MainActivty
[Activity(Label = "", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)] public class MainActivity : AndroidActivity, IAppNavigation { protected override void OnCreate(Bundle bundle) {
Android LoginActivity
[Activity(Label = "", ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)] public class LoginActivity : AndroidActivity, ILoginManager { protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); Xamarin.Forms.Forms.Init(this, bundle); SetPage(App.GetLoginPage(this)); } public void GetMainMenu() { StartActivity(new Intent(this, typeof(MainMenuActivity))); Finish(); }
In iOS, you do not need to do anything, just implement all the necessary interfaces that you are going to use in the application’s deletion.
iOS AppDelegate
[Register("AppDelegate")] public partial class AppDelegate : UIApplicationDelegate, ILoginManager, IAppNavigation {
source share