S5 Wont Charge While On

A

AC Question

So for some reason my Galaxy S5 will not charge while it's turned on. I try plugging it into the computer, into the wall, I use different charging cords, but so far nothing is working. However, the second I turn it off it will start flashing the charging icon across the screen. I'll turn it back on and it'll have charged a little, but once again it's no longer charging and will die again.

So... any solutions?