Hi,
showing a remote URL with a URI fragment in a WebView works fine. For example the URL https://www.b4x.com/android/help/views.html#webview_loadurl is shown in a Webview.
Using a local saved html file with framents does not work. Is there any way to show something like "views.html#webview_loadurl"?
This is the way I tried:
My example project is attached to this post.
Does anyone has an idea how to use a local file with URI fragments in a WebView?
Thanks,
Thomas
showing a remote URL with a URI fragment in a WebView works fine. For example the URL https://www.b4x.com/android/help/views.html#webview_loadurl is shown in a Webview.
Using a local saved html file with framents does not work. Is there any way to show something like "views.html#webview_loadurl"?
This is the way I tried:
B4X:
' Works
WebView1.LoadUrl("https://www.b4x.com/android/help/views.html#webview_loadurl")
' Using same page but localy saved
' Does not work
WebView1.LoadUrl(xui.FileUri(File.DirAssets, "views.html#webview_loadurl")) ' File is not found
' Does not work
WebView1.LoadUrl(xui.FileUri(File.DirAssets, "views.html") & "#webview_loadurl") ' URI Fragment is ignored
' Does not work
Dim strDir As String
strDir = rp.GetSafeDirDefaultExternal("html")
File.Copy(File.DirAssets, "views.html", strDir, "views.html")
WebView1.LoadUrl("file://" & File.Combine(strDir, "views.html#webview_loadurl")) ' URI Fragment is ignored
' Any ideas?
My example project is attached to this post.
Does anyone has an idea how to use a local file with URI fragments in a WebView?
Thanks,
Thomas