0
我要当的AsyncTask完成知道,这样我可以更新UI。的Android使用的AsyncTask更新UI
任何人可以帮助????谢谢!!!
public String[] getinfo(int id) {
String[] QueueNo = null;
try {
new DLfromServer().execute("url link"); // this is the asynctask
// want to do stuff here after the asynctask is completed
// actually I want to return a string result after the task is finished....
}
} catch (JSONException e) {
Log.e("GetJSON", "Err:", e);
}
return QueueNo;
}
你能介绍给例子如何在线程中调用AsyncTask.get()? Asynctask实际上是一个类,我从一个片段调用它......这是否意味着它不在主线程上? – 2013-03-18 05:10:36
@ user1702061:只需创建一个线程像Java和移动'字符串str_result =新DLfromServer()执行( “URL链接”)获得();'线程内运行方法。 – 2013-03-18 05:12:41