's documentation, reads the following: "Executes the given function with its arguments the next time the application is active".
a Function and
an array containing the arguments to pass to the function:
Shouldn't this code:
Execute the exact same code than this:
With the only difference that the first one will be executed only when the device is active?
's code and in case the Application is already active it will just do this:
if (sApplicationActive) call.apply(null, args);
Which (I believe) should execute the code in section (2).
But it's not happening to me. It's instead returning a coercion error stating the following:
TypeError: Error #1034: Type Coercion failed: cannot convert @24d22d5a54c1 to Function.
So, instead of getting the content of my parameters array and calling my function with those, it's sending the whole array instead.
According to its documentation
should receive an array as arguments.
"The parameters are specified as an Array object"
Am I missing something here? This only works properly if I code this instead:
SystemUtil.executeWhenApplicationIsActive(onSuccessFunction.apply, null, onSuccessParams);