Android Question Scrolling HTML content in WebView

Penfound

Active Member
Licensed User
Longtime User
I have a page the queries a db to create an html file that it loaded into a webview. So far it all works well except that the webview will not scroll and, as the html page can be varying lengths, I could do with solving this one.

This bit works as a static, fixed size page
B4X:
wxSessionPlan.LoadHtml(ExecuteHtml(Starter.SQL1, Query, Null, 0, True))

and this bit works
B4X:
File.writestring(File.DirRootExternal,"SessionPlan.html",sbHeader.ToString)

and, alternatively this bit works
B4X:
ExecuteHtml(Starter.SQL1, Query, Null, 0, True)

but this does not work
B4X:
wxSessionPlan.Loadurl("File.DirRootExternal/" & "SessionPlan.html")

it can't find the file which is in /storage/emulated/0 and does exist

Any help would be much appreciated as always
Thanks
Penfound
 

warwound

Expert
Licensed User
Longtime User
Try prepending "file:///" to the absolute file path of the HTML file you want to load:

B4X:
wxSessionPlan.Loadurl("file:///" & File.DirRootExternal & "/" & "SessionPlan.html")

If that fails then experiment with "file://" as File.DirRootExternal may return a path that already contains a single "/".
 
Upvote 0
Top