The lady who had the problem with her car’s headliner coming loose (the thin material covering the inside of the roof) needed a little more information than Tom and Ray supplied in my opinion. Rather than using generic-use spray on contact cement, like you’d find in a hobby or sewing store, replacing a headliner should be done with the special purpose headliner spray-on cement available in most auto-parts stores. In my experience at least, fixes using general-purpose contact cements available at hobby stores won’t last more than a few months before they start coming loose again.
Following the instructions on the special purpose headline cement package worked fine for me. I took the headliner completely off, including the trim pieces around the edge, and the dome light, then with the help of another person positioned it after applying the cement, and pressing it firmly against the roof using a small-size paint roller. Then I re-installed all the trim pieces.