Spread newspapers or a drop cloth in an outdoor location or an indoor location that is well ventilated. The more air circulation there is, the quicker the glue will dry on the foam rubber.
Lay the foam rubber pieces on top of the area positioned just as you want them to be attached.
Lift up one of the foam pieces so you can easily access the edge. Spray the edge thoroughly with a spray adhesive designed for foam. Cover the entire side of the foam, but don't allow the foam to become soggy. Wait 10 seconds to allow the adhesive to become sticky to the touch.
Lay the foam back down and press it up against the other piece of foam tightly using your hands. Hold the foam pieces together for one to two minutes. Release them gently.
Allow the foam to remain undisturbed for another five minutes to allow the adhesive to set up firmly.