how to get data back from onPostExecute

415 views Asked by At

I have a class which is implementing FilterQueryProvider and having an inner class which is extending AsyncTask. I am using this inner class to call a REST API and getting data successfully in onPostExecute which is MatrixCursor. But I want this MatrixCursor data in runQuery() method of outer class.

I am calling REST API in onCreate method. How can I get it in runQuery method???

1

There are 1 answers

3
johntheripp3r On BEST ANSWER

Declare matrixcursor in the Activity class, initiate it on onCreate and use the same in the inner class. you can then access and modify if from inner async task and access it from activity class.
Ex.

mAsyncTask.execute(....);
mAsyncTask.get();
runQuery();