Muscle cramping can be caused by many things, potassium being one of them. If you are taking a diuretic, this can aggravate it. If this is the case, your doctor should do a blood test to see if your electrolytes are normal. If your potassium is low, you will need a prescribed supplement. You might have to eat an awful lot of bananas.
However, if you think potassium will help---other high sources are potatoes and tomatoes, as well as citrus fruits.
Some other things could be causing it, or at least aggravating your condition. A low blood calcium level will cause cramping. You might try a good calcium supplement, or again, ask your doctor to check your blood level.
Another cause is dehydration. Older people can become dehydrated without even knowing it. Make sure you are drinking 6-8 glasses (8 oz) of water every day along with some fruit juice and milk. (more potassium and calcium).
Things like too much coffee, black tea, cola drinks and alcohol have diuretic effects and may cause dehydration and/or electrolyte disturbances. And again, as we age, our bodies become less tolerant, and are unable to compensate for our excesses.
So, to sum up, here's my suggestion to you:
eat lots of fresh fruit and vegies (including potatoes, tomatoe and citrus, along with the bananas.
drink plenty of fluid
drink 3 glasses of milk everyday
try a calcium supplement
get some exercise and sunshine (for Vit D) everyday. A 20-30 min walk, doesn't have to be strenous, would work.
If that doesn't work, or you have other conditions (or are taking medications) that would prevent you from doing these things----
Call your doctor for an appointment to evaluate the condition and do some blood tests.