How to return an object from the asynctask to the main class in android

前端 未结 3 1489
夕颜
夕颜 2021-01-24 21:29

I want to return the document to my main class but even using a global variable dosen\'t work it\'s because the asynctask didn\'t finish the job I think is there a solution to g

3条回答
  •  情书的邮戳
    2021-01-24 21:52

    You could just call an other function, for example:

        protected void onPostExecute(Document doc) {
            documentIsReady(doc);
        }
    
    }
    
    public void documentIsReady(Document doc)
    {
        //Do somehting
    }
    

提交回复
热议问题