California Supreme Court decision In re Smith

In re Smith (1972) 7 C3d 362, 102 Cal Rptr 335, 497 P2d 807 (excerpts):
"A person does not expose his private parts 'lewdly' within the meaning of Penal Code Section 314, condemning indecent exposure, unless his conduct is sexually motivated. Accordingly, a conviction of that offense requires proof beyond a reasonable doubt that the actor not only meant to expose himself, but intended by his conduct to direct public attention to his genitals for purposes of sexual arousal, gratification, or affront.

"Absent additional conduct intentionally directing attention to his genitals for sexual purposes, a person who simply sunbathes in the nude on an isolated beach does not 'lewdly' expose his private parts within the meaning of Penal Code Section 314, condemning indecent exposure."

Note that persons who are found guilty under Section 314 must register as sex offenders, according to California Penal Code Section 290

Full text of ruling