Chosen Solution

when i change my samsung S 4 the phone go on & off , next how to set secret codes,service/test menu. thank you

Do you mean when you charge the phone’s battery with electricity? If so, try a different cable and charger. If it still doing the same thing with a different cable and charger, your charge port on the phone bay be damaged and needs to be repaired.