Xamarin form is restarted when android change to multi-window mode

Cansado2930Cansado2930 ✭✭ESMember ✭✭

Hi,
I have added on my xamarin form app the option of multi-window mode of android 7 and when I activate this mode, the app is restarted. Are there some sample about I should develop it in order to continue without restart app? or Could you give me some advice about this problema?
Thank you!

Answers

  • AndrewMcCormackAndrewMcCormack ✭✭ USUniversity ✭✭

    Did you find out how todo this with Xamarin Forms?

  • Cansado2930Cansado2930 ✭✭ ESMember ✭✭

    hi Andrew,
    No, I haven't found the solution yet :( And I have the same problem with PiP of Android. MainActivty is reloaded and I don't know avoid the reset of XF.

  • Anderson_VieiraAnderson_Vieira ✭✭ Member ✭✭

    @Cansado2930 said:
    Hi,
    I have added on my xamarin form app the option of multi-window mode of android 7 and when I activate this mode, the app is restarted. Are there some sample about I should develop it in order to continue without restart app? or Could you give me some advice about this problema?
    Thank you!

    Hey this help your ?

    https://github.com/xamarin/monodroid-samples/tree/master/android-o/PictureInPicture

  • Cansado2930Cansado2930 ✭✭ ESMember ✭✭

    Thank you, yes, it is useful but It is a sample of Android, and I have the problem with Xamarin forms, because when user launches the event to change the mode, Xamarin forms pause… and I don’t find the correct step to avoid Xamarin stop. The ugly method, it stops and I activate a button in order to user can tap to play…. But the good is it continue without stop.

  • Anderson_VieiraAnderson_Vieira ✭✭ Member ✭✭

    Do you can share your code? @Cansado2930

  • chetanrawatchetanrawat ✭✭✭ USMember ✭✭✭
    edited April 2

    Hi, @Cansado2930

    I have created a demo app but I have not found the same problem
    can you share your code of mainactivity and app.xaml.cs

  • Cansado2930Cansado2930 ✭✭ ESMember ✭✭

    I may create a cleaned project about it, but I need some days in order to do it. I have some questions for you, @chetanrawat Are you using a custom render for videoplayer? I'm using a Navigationpage, how do you distinguish between paused app and the pip moded? Because the same event is fired.
    Thank you!

Sign In or Register to comment.