title: Android app/activity disposes when switching to another app
body: <p>I've been asked to fix an android application which has issues after switching to a newer device. The switch was from android 7/8 to 11. The application opens up google maps for navigation but very often when returned to the app all data is lost, and clicking on anything will reset it back to the startup activity. It doesn't matter which apps it switches between the issue happens with all of them.</p>
  <p>I've tried several things:</p>
  <p>-Disabling all battery saving options on the device</p>
  <p>-Using OnSaveInstanceState to retain the data</p>
  <p>-Using a backgroundservice to retain the data</p>
  <p>The issue only occurs on actual devices, using an emulator results in no errors.</p>
  <p>When the debugger is attached to the application it loses its connection before returning to the app. It is possible to re-attach when returning to the app but it disconnects as soon as
  anything is clicked.</p>
  <p>And best of all there's literally no error message shown anywhere.</p>