If it's just the cloth coming loose, it's possible that any adhesive will come through. If the rubber backing is coming loose from the headliner shell, you can use regular headliner spray adhesive.
Headliner material is relatively cheap. I bought enough at Hobby Lobby for less than $20.