B4J Question WebView Stop and Reload

JJ37

Member
I found this code that I want to add stop and Reload to for basic webview functionality.

How to add stop and reload?

B4X:
Public we, tp As JavaObject

' Init
we.InitializeNewInstance("javafx.scene.web.WebEngine",Null)
    tp = WebView1
    we = tp.RunMethod("getEngine",Null)

' Use with
Sub BackButton_MouseClicked (EventData As MouseEvent)
    we.RunMethod("executeScript",Array As Object("history.back()"))
End Sub

Sub forwardButton_MouseClicked (EventData As MouseEvent)
    we.RunMethod("executeScript",Array As Object("history.forward()"))
End Sub
 
Top