Load local file in native web browser when no network?

Hello,

I know how to add the webView control in my app and load a website. But is there any way to load a local html file when there is no network connection? All I want to show is a message saying there is no internet available.

Thanks

Warren

Why wouldn’t you do that Corona?  Does it have to be in the webview?  Regardless, you can access local files like this:

webView:request( “localfile.html”, system.ResourceDirectory )

You can also write an HTML file out to system.DocumentsDirectory or system.TemporaryDirectory and read the file back from there if you need to create more dynamic content.  See:

http://docs.coronalabs.com/api/library/native/newWebView.html

Thanks but is there any way of telling if the network/internet is not available for loading a remote web page?

Why wouldn’t you do that Corona?  Does it have to be in the webview?  Regardless, you can access local files like this:

webView:request( “localfile.html”, system.ResourceDirectory )

You can also write an HTML file out to system.DocumentsDirectory or system.TemporaryDirectory and read the file back from there if you need to create more dynamic content.  See:

http://docs.coronalabs.com/api/library/native/newWebView.html

Thanks but is there any way of telling if the network/internet is not available for loading a remote web page?