I have an outer class method that executes an inner class extending AsyncTask, and I want that outer method to then sleep till the AsycnTask tells it to continue. Basically, I am pulling something from a DB in the inner class, and calling it from the outer class, however I need the outer class to wait till it has actually been retrieved before it tires to access it.
public class A{
String response;
public String returnResponse{
new B().execute();
// wait for signal from B
return response;
}
private class B extends AsyncTask<String, Void, Void>{
response = string pulled from online db;
//once response has been set, signal A.returnResponce to stop waiting
}
Any ideas?
Thanks,
use this
instead of your code
this will wait for signal from B.