Without seeing your code how do expect us to help you?
The best practice is to post a small project as a zip file (IDE file menu Export As Zip) showing the problem.
So see what exactly you have done, test it in the same conditions as you do to find the problem.