Hi
I was once told to tense the muscles in the opposite leg, and then slowly release them again. It has worke dfor me in the past, and although i have since been told that tensing the muscles in both legs will work just as well, I have not tried it.
I believe that this works by initially decreasing the blood supply to the muscles, and the body responds by dilating the arteries to compensate, thus increasing the blood flow and oxygenation to the tissues, helping them to get rid of the lactic acid responsible for causing cramps.
Give it a try, i really hope it works for you too.