Hi,
I’m creating a UPL plugin which has a listener callback on the Java side. I would like to know how I can wait for the callback to finish before I continue with my execution?
I’ve tried the following and both return the value before executing my listener.
Locks:
Using a synchronous lock and using notifyAll() once I reach the listener method.
This ended up blocking my UI thread and never got released.
CountdownLatch:
Used latch.await() and latch.countdown() methods. But that didn’t wait for my listeners to finish calling either. Is there a better way to do this?
Thanks.