I have an event sub from a library that I want to call on Activity resume. I found a thread that suggested type should be used for the variables but I keep getting a signature mismatch error.
The main purpose of this is to be able to use a timer to keep the data refreshed.
java.lang.Exception: Sub monitor_getusagedata signature does not match expected signature.
public static anywheresoftware.b4a.pc.RemoteObject test.appusage.main_subs_0._monitor_getusagedata(anywheresoftware.b4a.pc.RemoteObject) throws java.lang.Exception
class anywheresoftware.b4a.pc.RemoteObject, class java.lang.Long, class java.lang.Integer,
Type Usage (UsageData As List,TotalUsage As Long,Duration As Int)
Sub Activity_Resume
Monitor_GetUsageData
End Sub
Sub Monitor_GetUsageData (v1 As Usage)
...do something
End Sub
The variables declared for the type "usage" works when used directly in front of the Sub. The problems arises when I try to parse them in with a type
If the event sub is called from a library that you haven't created then you can't change the signature. The call from the library will be expecting the original signature.
Also when you call the sub from within Activity_Resume you need to pass appropriate parameters.