My samsung s4 active wont charge even plugged in until restarting my phone

A

AC Question

I have a samsung galaxy s4 active and it works well until last night... its late night and i charged my phone overnight...it charged up to 100% but when i tried to charge it again in the afternoon,it didnt charged even plugged in and when i turned it off it just shows the battery loading icon then shuts off then restarts the whole thing like every 5 seconds...i dont know why does it happen last night i was using my phone,had no problems,and charged properly..then wtf just happened?it only charges when restarted...

Somebody give a reliable answer plss