[My Samsung Galaxy s5 keeps turning itself on & off]

A

AC Question

My Samsung Galaxy s5 keeps turning it self on and off, also freezing up. It seems to be getting hot. I remove the battery for a while and sometimes it comes back on until it gets hot again. Is this the battery or a flaw w/the s5's? Wondering if I need to purchase a new phone or just the battery. JP