expo-av lifecycle when Activity is re-created on Android?

I have an (ejected) Android app using the expo-av API to play sounds. When the app’s main activity is shut down and then re-launched by the OS (e.g. after being in the background for a while), expo-av starts throwing exceptions, because my JavaScript code still has references to sound objects that were deleted by the onHostDestroy() listener inside of AVManager.java.

I’m just wondering what the lifecycle story is for expo-av on Android, with respect to re-creation of the main activity. It seems like Android likes to do this “soft reboot” of the app, where most of the React state stays intact - including pending Promises that have references to expo-av objects - only the main app component is unmounted and then remounted. But expo-av’s state gets wiped, so things seem out of sync.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.