Samsung Galaxy S2 shuts off when plugged in: screen goes black then a grey empty battery appears
I followed this approach and it worked for me (and looks like for other people too):


  The way I got mine working was, remove the battery, plug the charger in, wait 5 seconds then start touching the battery on and off of the contacts on the phone, did this quite quickly, then the phone will vibrate. As soon as it starts vibrating, push the battery into the phone so it's permanently on. I got a picture saying the battery with nearly fully charged. Then when the picture goes off, the red LED came on to say it was charging. I left it like that for an hour, then turned it on and it's been working since.