failing to load page into webview from system.documents directory on android

I save index.html in the system.DocumentsDirectory then request that page but get a “there was a network error” alert.

* The file exists (I tested with system.pathForFile)

* The file displays fine when it is read from the system.ResourceDirectory

* I added Internet permission 

code:

local webView = native.newWebView( 0, 0, 320,480 )

webView:request( “index.html” ,system.DocumentsDirectory)

my android is a samsung  galaxy s3. 

Is there something I am missing?

thanks!

    

I’m guessing that your “index.html” file references files/sources from the Internet, in which case, you need to add the Android INTERNET permission to your “build.settings” file as shown here…

   http://docs.coronalabs.com/api/type/WebView/request.html#gotchas

If your local HTML file does not reference anything from the Internet, then the above permission is not necessary.  An example of this can be seen in sample project “Interface/NativeDisplayObjects” that is included with the Corona SDK.  Even though that sample uses a web popup, it still uses the same underlying Android WebView code that Corona’s web view uses.  So, the idea is the same.

I’m guessing that your “index.html” file references files/sources from the Internet, in which case, you need to add the Android INTERNET permission to your “build.settings” file as shown here…

   http://docs.coronalabs.com/api/type/WebView/request.html#gotchas

If your local HTML file does not reference anything from the Internet, then the above permission is not necessary.  An example of this can be seen in sample project “Interface/NativeDisplayObjects” that is included with the Corona SDK.  Even though that sample uses a web popup, it still uses the same underlying Android WebView code that Corona’s web view uses.  So, the idea is the same.