Welcome to the async world! ;-)
I had the same problem. Since the code of an async callback is not
executed in the order of the statements in your myMethod() you can not
directly return the results from onSuccess() in myMethod(). And
myMethod() is not able to "wait" for onSuccess().
You could for example do the things you want to do with
ArrayList<String> in onSuccess() instead of where you call myMethod()
of if you want to keep the processing logic for ArrayList<String>
where myMethod() is called use a method to pass ArrayList<String> from
onSuccess().
You can think of it as separating the logic in two methods:
1) first one does initial stuff and then requests something via RPC
(in your example via myMethod() but with return type void)
2) second one is called by onSuccess() passing the results of the RPC
and continues with the requested data where first method "ends"
Hope it helps,
Andreas