My 4a started doing that often and I couldn't find a fix for it. It got to the point that I couldn't use it for more than 5 mins without it shutting off and I had to get a new phone. :(

You might be able to factory reset your phone and see if that helps.