Just to add to the previous answer, I've fixed a similar problem by applying some Blu Tack on the battery - it never switched off ever again.
open