I am reading variables from an Android app using the following wrapper code:
Once this starts and I hit the back key and the onPause() executes how best to cancel the
async execution?
Async.executeAsync(aDevice, new Async.ApiWork<ParticleDevice, Integer>() {
public Integer callApi(ParticleDevice particleDevice)
throws ParticleCloudException, IOException {
return particleDevice.getVariable("myVariable");
}
@Override
public void onSuccess(Integer value) {
Toaster.s(MyActivity.this, "Room temp is " + value + " degrees.");
}
@Override
public void onFailure(ParticleCloudException e) {
Log.e("some tag", "Something went wrong making an SDK call: ", e);
Toaster.l(MyActivity.this, "Uh oh, something went wrong.");
}
});