Galaxy S4 Turns Off by itself sometimes

I had the same problem. I received a replacement battery. it did not happen with the new battery. since both batteries were Samsung original I did examine if there is any difference. to my surprise I did find that there are differences. The first battery that would die on me have the electrical contacts indented (more inside the plastic). See pictures. My suspicion is that the first battery looses contact (from the mating pins) and then the phone turns off.
zzz2.jpgzzz3.jpg
 
Now i don't know but on Youtube you can find loads of solutions and most are about the battery
I found one and indeed it works till now which is almost a month
Clean the connectors on the battery.That should do the trick.Seems there comes a film layer on it in time

All the other stuff about made in China or made in Korea is crap.Samsung checks all of it and both are good
Overheating from batteries appears mostly when you charge it while being on the phone or using skype or whatever
Best is not to use the phone while charging
 
Hey i had the same prob but mine is rooted. I did so on kingo. I check out the rom apps on play store. Im like a game addict playing injustice and it just shut down in the middle of my game. I guess its overheating. Since i did put these apps in it really helped. I dont see the shut down as often. Only when i play. Find some ROM apps to help
 
I recently have been having the same problems with two separate phones. My phone just decided to take a nap whenever it feels like it. I know this is a little dated but I love the s4. Have had s5 and an s6 but for some reason I just love the s4 better. Anyway has anyone had smart screen enabled. About the same time I enabled it is when I started having this problem with both phones. So on a whim I disabled it and haven't had a problem again. It's only been about a day without it falling asleep but may be a fix.
 
I recently have been having the same problems with two separate phones. My phone just decided to take a nap whenever it feels like it. I know this is a little dated but I love the s4. Have had s5 and an s6 but for some reason I just love the s4 better. Anyway has anyone had smart screen enabled. About the same time I enabled it is when I started having this problem with both phones. So on a whim I disabled it and haven't had a problem again. It's only been about a day without it falling asleep but may be a fix.

Thanks that helped. Disabled all smart settings from display menu and that resolved the issue.