Android Question file:///android_asset/ , webview, html

Status
Not open for further replies.

jchal

Active Member
Licensed User
Longtime User
i try to use the following line
B4X:
webview1.LoadUrl ("file:///android_asset/" & "1.html")
to show the html file in webview but when i load it it says web page not fount etc.
my question is where i put 1.html? in order to make it work?
 

Star-Dust

Expert
Licensed User
This isn't correct
Copy file to another folder, after can load to WebView. (File.copy command)

You can't load directly Assets filder.

Ps. Can link Asset path with file.DirAssets
Path = 'file:/' & File.DirAssets
 
Upvote 0

Star-Dust

Expert
Licensed User
1.
B4X:
webview1.LoadUrl ("file://" & File.DirAssets & "1.html")

2.
B4X:
file.copy(File.DirAssets,"1.html",File.DirDefaultExternal,"1.html")

webview1.LoadUrl ("file://" & File.DirDefaultExternal & "1.html")
 
Upvote 0
Status
Not open for further replies.
Top