What did Hashem hear?
Malbim: His Tefilah. Therefore, the decree was canceled; Yoshiyah will not be exiled.