For the past month my S2, SPH-D710, Android 4.1.2, will randomly restart throughout the day. I took the battery out for awhile and that didn't change anything. Sometimes it happens when I'm looking at it, sometimes it will happen as soon as I plug it into a charger.. at which point it appears to completely drain the battery. Seems to be only one of my chargers though. Other charger is fine. There is no clear pattern to all this. These issues don't happen all the time. Sometimes I'll go through an entire day with no problem. Warranty expired on the phone. I have never installed a custom ROM on here. Is this something that might be fixed with a custom ROM or is it completely hardware?
Should be an hardware issue.
In my case was the oxidation of the motherboard cause by the sweat cuase i kept the phone on my arms while I was running.
Thanks everyone for your feedback. In my case, there seemed to be no coming back from the dead. Tried the rice, tried a new battery, tried a hard reset. Nothing fixed it. Ended up getting a new phone.