I'm new to java/android.
I have an service class that have 2 methods.... prepare() and execute()..
both are async calls, so what I have to do is, call prepare() and wait for prepareFinished I'm listen to.... when the prepare method is finished, for the same service instance I'd like to call execute() method.....
Follow my try below:
for(int idx = 0; idx < services.length; idx++)
{
MyService instance = services[idx];
instance.setDataReadListener(new AsyncDataReadListener() {
@Override
public void prepareFinished(ServiceInfo info) {
//I would like to get the self instannce here to call another
//method after been prepared. something like::: sender.execute()
}
});
}
//In a button click I call above, for each service its prepared I would like another method of the same service instance to be called:
for(int idx = 0; idx < services.length; idx++)
{
MyService instance = services[idx];
//async call
instance.prepare();
}
How can I accomplish it?
Tks.