This happend to me in another car due to age. Most auto parts stores sell headliner specific sprays.
Just make sure to clean both surfaces as much as possible and note if it's contact glue, meaning you have to let both dry before you touch them together. Try to stretch it out too. If the rest of the headliner is bad, then it might be worth it to remove it all and just get a replacement headliner.
Have you thought about just taking it off and putting on leather or suede? How about a rich textured cloth like on some Audis? Obviously the OEM headliner will be a ripoff. If the backing is still good, just some ideas.
Just make sure that it will absorb the glue and keep it out of the sun, or else it will fade.
Make sure that when you use contact cement, that both sides are clean. If it's falling off, the backing is probably flaking and dirty. Use a vacuum cleaner or brush first otherwise it'll just fall off again because the glue won't stick.
VW TDI forum, Audi, Porsche, and Chevy Cruze Diesel forum
A forum community dedicated to Audi, Volkswagen, Porsche, and all turbo diesel owners and enthusiasts. Come join the discussion about performance, modifications, troubleshooting, TDI, maintenance, and more!