A. Check if your device has a battery saver mode enabled. If so, disable it for this app to prevent it from being closed when you leave.
B. Try to keep the app running in the background instead of fully closing it. Use the recent apps button to switch back to it without restarting.