i am doing some filesearching on the local disk with a inline Java call.
now i want to use the new Resumable Subs Functionality in this setup to let the GUI responsible:
B4X:
'just fragmentary:
'Sub which is calling the inline Java:
Sub searching (path As String,name As String)
Private nativeMe As JavaObject=Me
mylistview.Items.AddAll(nativeMe.RunMethod("getTheFiles",Array(path,name)) 'walk file tree
End Sub
'inline Java which is doing the heavy searching:
#If java
public static void getTheFiles(String dir, String pattern) throws IOException {
.
//walkFileTree
.
#End If
the questions are:
1) where and how could i use the "Sleep" Keyword in such a setup?
2) or is it a better way with the Wait For event?
But which event?
You cannot call Sleep or Wait For from inline code. Resumable subs is a compiler feature. The compiler converts the resumable subs code to a state machine.
You can raise regular events from the inline Java code (with ba.raiseEventFromUI) and use Wait For in your B4J code.