Answer
In the peace agreement with Charles IV, Edward II swore allegiance, acknowledging Charles as the Holy Roman Emperor. This agreement marked a significant shift in Edward's foreign policy, as he had previously supported Charles's rival, Louis IV. By pledging allegiance to Charles, Edward sought to strengthen his position and secure peace with the Holy Roman Empire.