This happened to me after I spilled a little water on the table and a bit splashed into the dock connector of the phone - it just crosses a couple connections inside, making it think that you've just plugged in some unknown charging accessory. Has the phone recently been near water or anything like that? If it has, then just give it a day or two to dry out.