Skip to main content

Posts

Showing posts with the label android-asynctask

return value from Async task in android

one simple question: is it possible to return a variable in Async task? //my async task is in outer class private class myTask extends AsyncTask<Void,Void,Void>{ //initiate vars public myTask() { super(); //my params here } protected Void doInBackground(Void... params) { //do stuff return null; } @Override protected void onPostExecute(Void result) { //do stuff //here! how to return a value??? } } // i execute it from my activity // codes below are from different class than the async task myTask.execute() myvalue = myTask.getvalue() //something like this????