Just open up your phone and clean the dip switch with some rubbing alcohol, not to much but do it a couple of times. Make sure to let it dry before you turn it back on.
This fixed mine.
That worked for me as well. When I bought my phone, the power button was so sensitive that even the slightest amount of pressure on it would cause it to boot or turn the screen off. I was going to return the phone, but a few minutes work with alcohol and a Q-tip saved me the hassle.
XDA Developers was founded by developers, for developers. It is now a valuable resource for people who want to make the most of their mobile devices, from customizing the look and feel to adding new functionality. Are you a developer?