How do you glue these back on?

How about the purple primer that is used with the abs cement for plumbing? Seems like that would work if you were careful.