Hi,
I need to intercept event from external lib.
In Android Studio i have this code:
When Call the ModuleIface.init the library call automatically onStatusChange, how can I intercept this event?
The object of the init are:
- Context
- ModuleIface
My try in B4A:
I need to intercept event from external lib.
In Android Studio i have this code:
B4X:
public class ScanDevicesActivity extends AppCompatActivity implements ModuleIface {
public void onItemClick(View v, int position) {
ModuleIface.init(this,ModuleIface.this)
}
@Overridepublic
void onStatusChange(int statusCode)
{
}
}
When Call the ModuleIface.init the library call automatically onStatusChange, how can I intercept this event?
The object of the init are:
- Context
- ModuleIface
My try in B4A:
B4X:
#AdditionalJar: mylibrary
Sub Test()
Dim R2 as Reflector
Dim Jo As JavaObject
Jo.InitializeNewInstance("mylibrary.KeyModule",Null)
Dim CallBack As Object = Jo.CreateEvent("onStatusChange", "Callback", Null)
jo.RunMethod("init",Array(r2.GetActivity, e))
End Sub
Sub Callback_Event (MethodName As String, Args() As Object) As Object
Log("onStatusChange")
End If