[T-Mobile Samsung Galaxy S 4] spicy_puerto_rican:
Dave, depending on the brand and sized amperage of your battery... the issue may be with the battery itself. After some in-depth tests, my turning off issue was not because of the gap caused by normal wear and tear of moving around in my pocket... it was a result of the ZeroLemon battery bulging when overheating and shrinking when cooling down too much too often.

I've had ZeroLemon extended batteries of 2 different sizes, 1 each for my S3 and S4 and they both were (excuse my French).... completely ****ty!! I highly DO NOT recommend ZeroLemon extended batteries to anyone for any device, no matter how great of a cost deal you think you're getting and/or the battery's extended mAh size!

Look at taking some rubbing alcohol and a Q-tip to clean off the battery terminals on the back of your phone first and foremost. Then (by default), look at replacing your battery because some batteries do tend to bulge way more often than they should (ahem, cough* cough*... ZL). If you do end up buying a different battery, do not get any other battery made by any other company beside Anker! With the Anker 7800 mAh extended battery it does NOT bulge at all and does NOT overheat EVER! I would be safe to say that all of Anker's other smaller mAh batteries probably hold up just as well.

If you clean off your battery terminals and replace your battery but your phone still shuts off with the slightest touch on the table... the issue has probably something to do with the circuitry/soldering of the wiring on the phone's motherboard to the battery that has burned out and gone bad? It could also be that the "shock/gyro" sensor built inside of it may have gone bad so when you set it down on the table, the motion of the phone touching the table triggers the phone to shut off with the slightest movement/hit because the shock/gyro sensor can't function properly?

This shock/gyro sensor was an issue with my S3 at one point in time a long while ago because I had often dropped my S3 while it was in a really crappy-built ZeroLemon/Hyperion/3rd party no-name brand really soft TPU case that I had bought on Amazon. By then, I ended up upgrading to the S4 and replacing the S4's factory battery with the ZeroLemon 7500 mAh extended battery at first... until the ZL bulging culprit, then switched to the even bigger Anker 7800 mAh Extended battery. Back then, I knew the ZL battery was the culprit because when I took the battery out of the phone and case, the battery itself was insanely hot to the touch and you could visually see that the battery swelled significantly. When the battery abnormally swells, the battery cannot properly connect to the phone's terminals, so the battery touches the terminals at a very acute angle momentarily most of the time, which allows you to get life to the phone... until you set it down on the table and it looses its connection. Since the switch from ZL to Anker, I've yet to have any unintentional turning off issue of any kind and it's been about 2 years now. So yes, your issue happened with me and my S3 and it started with me noticing the phone shutting off when I set it on the table and picked it up like 20 mins+ later.

So change your battery to an Anker one, get a better TPU case, and don't drop your phone as much as you probably did. If you get the ZL ZeroShock Rugged case for 7500-7800 mAh extended batteries, you can drop your phone from as (reasonably) high as you want and nothing will happen to it.