Saved searches

Use saved searches to filter your results more quickly

Cancel Create saved search Sign up Reseting focus

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

This repository has been archived by the owner on May 1, 2024. It is now read-only.

xamarin / Xamarin.Forms Public archive

[Bug][Android]App does not resume but restart activity after being put in background and re-opened #12050

Suprndm opened this issue Sep 8, 2020 · 18 comments

[Bug][Android]App does not resume but restart activity after being put in background and re-opened #12050

Suprndm opened this issue Sep 8, 2020 · 18 comments p/Android s/unverified New report that has yet to be verified t/bug 🐛

Comments

Suprndm commented Sep 8, 2020 • edited by StephaneDelcroix

Description

On Android, when the app is re opened after being put in background, and only after being freshly installed, the activity is rebuilt from scratch, instead of being resumed. All filled information is lost.

Steps to Reproduce

  1. Install a Xamarin App from store or APK, on Android
  2. Open the application
  3. Put the application in background
  4. Reopen it by tapping its icon

Expected Behavior

Actual Behavior

Basic Information

The text was updated successfully, but these errors were encountered:

ChristianTBaker commented Nov 3, 2020

Same issue for me on Android 11.

emjy86 commented Nov 19, 2020 •

Same issue on real device under Android 9.0 with Xamarin Forms 4.8.0.1687

App.OnStart is called instead of App.OnResume

archergod commented May 26, 2021 •

I have similar issue (not sure if it is same). But here is what I found. I am still in development environment and notice this issue.

So Android is putting app in 2 different state which might be causing different behavior when bring back from background.

Also, When I run app by tapping icon or first time it works without problem, but when it come from background to reinitialize it crashes as OnStart function behave differently, ie. in my OnStart I was syncing some data from server in sequence. But when it reinitialize it fail to sync data and cause data to miss their order of syncing causing error in my application.

Expected Behavior is

  1. It should treat bring from background as one. So OnResume is called everytime.
  2. If it is not "resume" then it should initialize completely not partially, (i.e. my FlyOut menu page try to load data before Onstart is finished ).