Exercise (even restless movement) while underweight only decreases bone density

Even strength training won't increase that bone density! And doing things like restlessly moving, like pacing around a room, will break down your bones more and more.

From Dr. Jennifer Gaudiani's Sick Enough, about a study from Canada (emphasis mine):

"A group of young women with anorexia nervosa and amenorrhea and a recovered group, who were weight restored and had resumption of their menstrual periods, tracked their exercise. Those who were still ill, who exercised even moderately—and the authors included restlessly walking around in the moderate category—developed worse bone density than ill patients who did not exercise. The good news, though, was that after recovery, even high intensity exercise improved bone density compared with not exercising. It makes sense that when the body is nutritionally stressed and hormonally depleted, requiring it to exercise would further deplete its stores."

So, if you're anorexic, stop exercising. You aren't feeding your body enough to even maintain basic health. Any exercising you do, thinking it's building up your bones or making you stronger, is actually breaking you down. End the cycle of self-harm by finally taking a rest.

Society tells people to move more and lift weights, but that message isn't geared toward people who are medically compromised by anorexia. If you're anorexic, ignore that message. It's not for you.