java - Get self instance inside interface implementation -
i'm new java/android.
i have service class have 2 methods.... prepare() , execute()..
both async calls, have is, call prepare() , wait preparefinished i'm listen to.... when prepare method finished, same service instance i'd call execute() method.....
follow 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 self instannce here call //method after been prepared. like::: sender.execute() } }); } //in button click call above, each service prepared method of same service instance called: for(int idx = 0; idx < services.length; idx++) { myservice instance = services[idx]; //async call instance.prepare(); }
how can accomplish it?
tks.
make instance final:
final myservice instance = services[idx];
and can call instance.execute()
inside preparefinished
.
Comments
Post a Comment