integra rubber windshield trim repair question

Hi, I have a 2001 Acura Integra. The black rubber trim at the top of the windshield is loose and every once in a while the trim unseats itself
from the gap betweenthe windshield and the metal roof. I have not noticed any water leakage problem so I assume this rubber trim does not act as a seal. However, I would like to repair the trim so that it does not keep coming unseated. Can anyone out there recommend a silicon or similar adhesive product that would be appropriate for such application? Thanks in advance for your replies.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
Add image file
Upload is a website by car enthusiasts for car enthusiasts. It is not affiliated with any of the car or spare part manufacturers or car dealers discussed here. All logos and trade names are the property of their respective owners.