IPhone 3gs restarts itself while charging?

I just bought this off ebay, first smart phone to own. So I plug it in to the computer and it switches from Apple logo and back to the dead battery image. It does charge however I'm just wondering why it does this.

Added (1). Also sometimes shows: restore Iphone on itunes, it would solve this maybe

Trying charging it for the first time off an AC line. Then you can sync it with your computer. Just a guess, I have the 4G.

  • My iPhone turned off by itself and turned back on while using a app? When I was on YouTube my phone just shutted off by itself then turned on. Is there something wrong with the phone. Also when I click my home button one time the phone sometimes wouldnt come on till the second click. What can I do?
  • My iPhone restarts itself constantly? Ever since last night, whether it was plugged in and charging or not, my iPhone restarts itself every 3 minutes or so, whether I'm using it or not. The battery was recently replaced and is fully charged, and I've restored it at least 3 times now, so I feel as though I'm out of options. I also have the latest version of IOS or whatever. Any suggestion?
  • My iPhone 4s won't shut off, it just restarts after a few seconds? When I shut my phone off I slide the "slide to power off" thing it's circle pops up like its shutting off and then after a second the apple icon pops up and the phone turns back on.
  • My iPhone 4s' brightness is turning itself low by itself? - 1 How do I fix this? Is it a bug? I have the iOS 6.1.3 installed. I did drop it in water like 2 weeks ago but I made sure all the water came out, my step mom dropped her phone in the toilet like a year ago and till this day it works perfectly fine! So why is mine having problems?