I have a setup with a relay that disconnects mains voltage for a project.the problem i have is that the relay works fine when i connect it to the arduino and power it from a laptop but i changed the source to a mobile charger with sufficient current rating it just keep turning on and off .i think that after turning on it keeps shorting as the arduino resets too i have also tried it directly by removing arduino and just powering it through the charger same thing happens. i have changed the charger once too . one thing to be noted is that i tried another cell phone charger with output:5v and current :1A it worked with it .
** EDIT:** turns out it was my own mistake ,the input wiring for powering the charger were mixed with the relay . fixed now thank you all for the help !