I can see the text, html, in log, but the WebView is not visible.
See attached image.
B4X:
Sub Class_Globals
Private pnl As Panel
Private HTMLWebView As WebView
Private bnOK As Button
Dim Done As Boolean
End Sub
'Initializes the object. You can add parameters to this method if needed.
Public Sub Initialize(Act As Activity,FileName As String)
Done = False
BuildScreen(Act,FileName)
End Sub
Private Sub BuildScreen(Act As Activity,FileName As String)
Dim ScrRowHeight As Int : ScrRowHeight = 7.5%y
Dim ScrColWidth As Int : ScrColWidth = 10%x
Dim colOffset As Double
Dim HTML As String = File.GetText(File.DirAssets, FileName)
pnl.Initialize("pnl")
pnl.Color = Colors.Gray
Act.AddView(pnl, 10%x, 10%y, 80%x, 80%y)
pnl.BringToFront
'--------------
'Row WebView
'--------------
HTMLWebView.Initialize("")
colOffset = 0.0
SetWebView(HTMLWebView, (1 + colOffset) * ScrColWidth,1 * ScrRowHeight, 6 * ScrColWidth,6 * ScrRowHeight)
HTMLWebView.LoadHtml(HTML)
' Log(HTML)
'--------------
'Row OK
'--------------
bnOK.Initialize("bnOK")
colOffset = 0.0
SetButton(bnOK, "Close", (1 + colOffset) * ScrColWidth,10 * ScrRowHeight, 6 * ScrColWidth,1 * ScrRowHeight)
End Sub
Private Sub SetWebView(obj As WebView,LPos As Int,TPos As Int,WPos As Int,HPos As Int)
obj.Color = Colors.Blue
pnl.AddView(obj,LPos,TPos,WPos,HPos)
End Sub
Private Sub SetButton(bn As Button,text As String ,LPos As Int,TPos As Int,WPos As Int,HPos As Int)
bn.text = text
bn.Gravity = Gravity.CENTER
bn.TextSize = 12
bn.TextColor = Colors.Black
pnl.AddView(bn,LPos,TPos,WPos,HPos)
End Sub
Private Sub bnOK_Click()
pnl.RemoveView
Done = True
End Sub
See attached image.