【发布时间】:2014-05-20 09:55:25
【问题描述】:
是否可以获取doInBackground()方法的返回值?
JSONArray response = new SupportFunctions.executeURLWithResponse().execute(url);
它告诉我:
Description Resource Path Location Type
Type mismatch: cannot convert from AsyncTask<String,Void,JSONArray> to JSONArray ContactFunctions.java /BuddyCheck/src/com/pthuermer/buddycheck line 138 Java Problem
这样的?
【问题讨论】:
-
您尝试阅读文档了吗?
-
如果任务在单独的文件中,您可以使用
interface。 Here is an example 否则可以更新值或调用函数来设置onPostExecute()中的值 -
codeMagic是对的,你需要
@Overridevoid onPostExecute(Result result) -
然后呢?结果在哪里?我不能从 onPostExecute 中返回一些东西,对吧?
-
查看我关于使用界面的链接答案
标签: android android-asynctask return