Android Question Measure content hight in webview

bluedude

Well-Known Member
Licensed User
Longtime User
Hi,

I have a webview which contains markdown language. I need to show all text by default in a custom listview without having to zoom.

Is there a way to measure the height of the content in a webview?
 

bluedude

Well-Known Member
Licensed User
Longtime User
That seems to be a tough workaround. I basically need an autosizing view that can display HTML/markdown.

What I do now is adding it to a custom listview (as text) and then measuring the height of that but is does not work very well.

Other suggestions which are easier?
 
Upvote 0

teddybear

Well-Known Member
Licensed User
Could you give example? I am not good in Java.
Javasctipt is not java. you can get the document height using javaobject
B4X:
Private Sub getWebDocHeight() as int
    Dim j as JavaObject = WebView1
    return j.RunMethodJO("getEngine", Null).RunMethod("executeSctipt", Array("doucment.body.scrollHeight"))
End Sub
 
Upvote 0
Top