My android phone keeps turning itself off

Are you saying while your charging it it keeps turing on and off? If that's what your saying, basic troubleshooting would be first to try it with a new battery and if that don't work, then try a new charger, then possible the charging port itself which another would have to be soldered on. If the new battery still does the same issue, take it to a small fair charging shop. At least that my opinion, possible more than an answer seeing you haven't gotten one.