I had the same problem with my epic 4g. Sometimes it would help to 'trick' it by switching to the browser which got it to stop sleeping then quickly switch back to the original app. I searched long and hard for a fix that would disable the sleeping mode to no avail. I'm sure though that if you root it you would have such an option. Good luck!