Your device may keep telling you it's offline when it is unable to connect to the internet. In some cases, incorrect login credentials and errors within the servers can also cause this error. However, some other reasons are:
Network Adapter Issues
System Errors or Glitches
Misconfigured Network Settings
Router Issues