leg cramps

I am looking for some advice....Last july I had a hip replacement done. Every now and then after that I started getting cramps in the inside of my leg from the knee to the groin. Happened very rarely but very painful. Over the last month since I joined the gym I get them all the time, now in both legs. I get them at night, when I try to get off the bed, I get them during the day even just certain ways I turn my body sets them off. I don't get cramps anywhere else just the inside of my thigh. When I put my hand on the spot when I am having a leg cramp you can actually feel the muscle move under the skin.
Is this caused by something I am missing in my diet? Is there something specific I should drink, such as sports drinks?
I really need some help :'(