Welcome to Android Central! Are you actually exiting the app before the phone locks, or is the app still in the foreground when the phone locks? If the latter, then check the Battery Optimization setting for that app in the system settings and make sure optimization is turned off.
Please register on this forum, which will allow you to engage in discussion more easily, as well as post images.
https://forums.androidcentral.com/as...community.html