I suggest some Icy Hot patches. I have alot of physical aches and pains all the time and that helps alot.
On a new injury, always use ice and follow the basic formula called RICE: Rest, Ice, compression with an elastic bandage, and elevation of the affected limb.
Some stretching and activity is okay and is recommended. You don't want the muscle to get too "cold" it'll extend the healing time. You also don't want to apply heat for the first few days, that will also extend the healing time.
If it just suddenly hit you as you were walking, it sounds like a circulatory problem within the muscle. It's either getting too much blood and oxygen or not enough. But I'm not there to see it, so don't take my word for it