My battery stopped charging when my phone was on.. Needed to relearn or something..

What I did was turn phone off and plugged it in a few times till it started charging.. Then when it was...