简体   繁体   中英

How to manage Xamarin forms app resuming from background on Android?

I have a Xamarin forms app that starts some processes to run a Bluetooth communication in the background.
The app works normally when it is sent to the background.
When I get it back in the foreground it kind of opens again and I don't know how to manage this situation.
When I press back for a split second I can see the previous instance of the app before it shuts down.

Any clue would be very much appreciated.

Thanks in advance!

Shiny is a robust new nuget package that makes managing backgrounding easy. Its a pretty complicated thing to do otherwise if you want to do it properly. The Nuget package also supports Bluetooth

The developer of Shiny also an MVP, Allan Ritchie presented Shiny at the Toronto. Net mobile developers meetup event, here's a video of it .

There's also a lot of examples for Bluetooth usage here. As you can imagine, Bluetooth & Backgrounding are two separate behemoths by themselves, so this helps unify and simplify them.

That said, he needs help with documentation, so please feel free to update us with how you used it!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM