Los Angeles Superior Court Judge Michael Carter made the ruling after concluding a preliminary hearing for Robert O'Ryan, who has been jailed since his arrest in March. Authorities say he trespassed on the lot where "Dancing With the Stars" is taped and tried to contact Johnson.
The 17-year-old Olympic gold-medal gymnast won the dancing competition earlier this year.
Johnson and her parents have obtained a civil restraining order against the 34-year-old Florida man. Authorities said they found a pair of loaded guns in O'Ryan's car and that he drove from Florida to Los Angeles to try to meet Johnson.