It is possible that the battery is damaged, the system is faulty, or the charger is due to poor contact. These aspects will cause the charge to die in a few seconds. We can:
1, change another charger, or data cable to try, or clean the charging port.
2, boot into the recover mode to select advancsd advanced mode, select wipe,battery, clear battery traces.
3. Restore factory Settings to see if it is a system reason.
4, If the battery is damaged, can only be sent to repair and replace the battery.
Maybe the battery is short of power, and the voltage will reach the maximum after a while. It is also possible that the battery is aging, charging fast and discharging fast, and there is no electricity after use. Battery aging, the battery is prone to such problems after 1-2 years of use, if the quality is poor, it is easier to break. Battery or charger connectors are loose or dirty, and the charger is damaged, such as a broken conductor.
This phenomenon is the reason for the poor contact of the charging head or line