Hi all,
I have a problem about the native.newWebView.
Please give me some suggestion. Thank you all.
I am trying to use native.newWebView to show local file, but it always show me the error “webpage not found”
The following is my code, please help me.
function save\_html(name,data) local path = system.pathForFile( name, system.DocumentsDirectory ) local myFile = io.open(path, "wb") if myFile then myFile:write( data ) io.close( myFile ) end local webView = native.newWebView( 0, 0, 320, 480 ) webView:request( name, system.ResourceDirectory ) end
I use save_html(“page.html”,data) to save file in the device first, parameter data is html text.
It always return “file:///android_asset/page.html” not found
I think maybe the error is caused by I save the file in the wrong path.
So the second question is how can I change system.ResourceDirectory?
Thank you again.