this problem is due the bad connectivity between the A/C adapter pin and the device power receptacle.

most of the time, the colored plastic circle is broken, just buy a new pin to repair your adapter.