IPhone 4 turns off by itself?

I got an iphone 4 a couple of days ago. I updated it to the latest iOS and everything was working fine. This morning I was on it for a few minutes and put it in my pocket. When I took it back out a couple of minutes later, to my surprise the lock screen would not come up. Assuming it had turned off, I tried to power it on, and it wouldn't. I held down the lock button and the home button together as well, and that didn't work either. Then around lunchtime, i tried to turn it on again and it did. Soon after my lock screen came up, it turned off by itself again. I tried powering it back on and it worked (for once). The phone functioned normally for about 20 minutes. I put it back in my pocket and when I got it back out later, again, it had powered itself off and I could not turn it back on. I just got home and plugged it in to itunes, and it came up saying that my phone is in recovery mode and that it must be restored to factory settings. So now I'm waiting for it to be restored.

My question is, what causes this? And is there any way to prevent it from happening again? It's quite frustrating, and I've seen many posts online related to this, so many people are experiencing the same problem.

Change phone, this is fastest way

  • Youtube on my iPhone turns on to desktop version by itself? Just very resently, everytime I would go on youtube using safari on my iphone, it turns to desktop every time. I tried typing in "m" for mobile version instead of "www", then it would load, but then turn to desktop whenever I search for something to watch. It's started to get on my nerves (I'm a very impatient person). Did this happen to anyone? Is there a way to fix this?
  • My iPhone turns itself on and off randomly? My iPhone 3GS has just started turning its self off and on like 20minutes ago and it's got 57% of battery left, I don't know what's wrong? And I don't wanna go to the apple shop because I don't want my mum to have to pay for a new one because we have a tight budget. And if I tell her she will go mad!
  • My iPhone's volume turns up by itself I got a brand new iPhone 4S and it just randomly decides that the volume needs to be turned up. WTF! It's not the case because I took it off and it still does it. It never turns down, only up. It mostly happens when I play games. This is so frustrating!
  • My iPhone's volume turns up by itself? I got a brand new iPhone 4S and it just randomly decides that the volume needs to be turned up. WTF?! It's not the case because I took it off and it still does it. It never turns down, only up. It mostly happens when I play games. This is so frustrating!