Enabling stream management to use it in smack android application openfire v4.7.3

I encountered an issue where messages are not delivered when the Wi-Fi or cellular data is turned off on an Android device. Even after re-enabling the network connection, the messages remain undelivered. How can I address this situation in the code using Openfire and Smack?

did you check Check the network connection ? or tried resending the message?

as, most of the time that is the issue.