2
在我的應用程序中,當我調用新的RetrieveFirstThreeArtUrl()。execute()doInBackground沒有被調用..有誰知道爲什麼?此代碼是工作前幾天,所以我不知道發生了什麼事..asyncTask的doInBackground沒有被調用?
public class RetrieveFirstThreeArtUrl extends AsyncTask<String, Void, Void> {
static final String APIURL = "http://ws.audioscrobbler.com/2.0/?method=album.getinfo&api_key=2ead17554acf667f27cf7dfd4c368f15&artist=%s&album=%s";
static final String APIURL_ARTIST = "http://ws.audioscrobbler.com/2.0/?method=artist.getinfo&api_key=2ead17554acf667f27cf7dfd4c368f15&artist=%s";
@Override
public void onPreExecute() {
super.onPreExecute();
Log.v("", "Pre");
}
@Override
public Void doInBackground(String... args) {
Log.v("", "Background");
return null;
}
@Override
public void onPostExecute(Void args) {
list = (ListView) rootView.findViewById(R.id.list);
adapter = new LiveAdapter(LiveStreamFragment.this.getActivity(), oslist, LiveStreamFragment.this, list);
list.setAdapter(adapter);
}
}
執行方法連續運行AsyncTask,所以如果你已經調用它,一旦下一次將在前一次完成後啓動 –
我不確定你的意思是完全是什麼...... –
你能否告訴你整行代碼new RetrieveFirstThreeArtUrl()。execute()。重寫方法的訪問說明符也受保護 – TechnoBlahble