Iphone 4 black screen, unresponsive?

Me iphone 4 is completely unresponsive and has a black screen, but when i plug it into the computer it gets into an endless loop. The apple logo will show up then the screen goes black and do it again and again and again and again.itunes doesn't recognize that its plugged in so i can't restore it.

Press the top and the bottom square at the same time then when it's on press the home button two times then when the thing on the bottom appears with recent apps, tap and hold on one of them, then press the minus buttons, it did this because you had to many apps open at once. Hope I helped!