Hello.
How load local file HTML writing w DirAssets to WebView ?
webview1 designer is stretched to fill the screen.
I displays error:
How load local file HTML writing w DirAssets to WebView ?
B4X:
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Private WebView1 As WebView
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")
Dim url As String= File.DirAssets&"opis.html"
WebView1.LoadHtml(url)
Activity.LoadLayout("form_info")
End Sub
I displays error:
B4X:
Copying updated assets files (1)
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Service (httputils2service) Create **
** Service (httputils2service) Start **
** Activity (main) Pause, UserClosed = false **
** Activity (info) Create, isFirst = true **
Error occurred on line: 23 (info)
java.lang.RuntimeException: Object should first be initialized (WebView).
at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:50)
at anywheresoftware.b4a.objects.WebViewWrapper.LoadHtml(WebViewWrapper.java:117)
at com.wmk.lok.info._activity_create(info.java:346)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:702)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:339)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:246)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
at com.wmk.lok.info.afterFirstLayout(info.java:102)
at com.wmk.lok.info.access$000(info.java:17)
at com.wmk.lok.info$WaitForLayout.run(info.java:80)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5461)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:134)
** Activity (info) Resume **