Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Redirect to Home Page from OpenUrl method

$
0
0

Hi,
Is there any recommended way to redirect to the home page after uploading any document ?
I am trying below code but it is not working after upload application is crashing.

Say when I select any document from email attachment , I can open it by selecting that document and open in my app option.
Then it comes to OpenUrl method with the correct fileUrl and I am able to upload it also.
However after upload I want to redirect to the next page so that I can show file name and other options in my next page.

Is there any other method I have to override for this or what should I do to correct my approach ?
Can anyone guide me how should I approach this. Thanks

  public override bool OpenUrl(UIApplication application, NSUrl fileUrl, string sourceApplication,
                NSObject annotation)
            {


                var formUpload = new FormUpload();

                formUpload.ProcessUpload(fileUrl);



                if (App.NavigationPage == null)
                {
                    Forms.Init();

                    _window = new UIWindow(UIScreen.MainScreen.Bounds)
                    {
                        RootViewController = App.GetMainPage().CreateViewController()
                    };

                    _window.MakeKeyAndVisible();

                    return true;
                }



                return true;
            }

Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>