Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
November 15, 2022 04:27 pm GMT

Single vs. Multi Page Android App

I wrote an App that was a single page using MVVM and I was just using a frame to hide/unhide areas. This is a location tracking app. When it was a single page when minimized or the screen was locked tracking and everything worked perfect.

I then found some issues with modifying map features when the frame it was in wasnt visible so I needed to change it to a multipage app.

For some reason now, when I go from Page 1 to the actual map page the map gets displayed, but as soon as the screen locks or the app is moved to background, the OnDisappearing event on the map page is fired.

I can stop it by changing the MainActivity from inheriting global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity to inheriting FormsApplicationActivity but that seems to create additional issues

I can also stop it by loading the map page (page 2) as a PushModalAsync page. This way caused the app to crash alot.

chaning the page inheritance works better, but it seems like it cannot fire messages using message center that I have in the onAppearing event of the mapPage.xaml.cs file.

Any thoughts on how to keep the app running, and updating in the background in a multi page environment?


Original Link: https://dev.to/steve_groner/single-vs-multi-page-android-app-2632

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To