Unfortunately I live in a big mean city and like to keep my light in my bag when my bike is locked up. A problem I've frequently encountered with my light is that it will randomly turn on in my backpack far too easily which drains the battery. Very frustrating.
I was able to solve this problem quite elegantly with Sugru.
1x - planet Bike rear light
1x - packet of Sugru