Shin splints are caused by three things, two of them related to overuse, the other is stress fractures.
If you tend to get shin splints that are localised pain then you are more likely to have the latter. If the pain extends further up the shin then it is either a carpel tunnel inflammation (basically RSI in your legs) or you have a mechanical problem.
Stress fractures have to have time to heal, and when you go back to running or the like you have to move into it gradually and run on softer surfaces.
Carpel Tunnel you have to rest and ice the shins, and try to ease back into running. It can be due to muscle strength imbalances, but also tiredness of the muscles can also be a factor. So easing into running is the best way and allowing time for the calves to recover between running sessions.
Mechanical problems are the tricky one. They can show up as both (usually the latter) and will occur from overuse but any use will cause problems. This is where you should consult a podiatrist and they will recommend the best course of action. Orthotics are the common solution, and not the cheap sports store inserts either.
Whichever is causing it I would recommend consulting a foot specialist if you intend on doing running regularly. Alot of doctors will charge you for the visit to tell you that you should see a podiatrist and take some antinflamatories. If your not going to be running regularly, then making sure you just take it easy and run on soft surfaces and ice the area after are probably best.