如此看來,這個問題需要詳細信息,所以我要解釋一下是什麼問題。
當我啓動我的應用程序時,我放了一個閃屏,然後我解析了我上次保存的本地JSON文件。然後我啓動應用程序,該應用程序包含一個帶有不同列表視圖的選項卡活動,這些列表視圖使用剛從JSON解析獲得的數據。
與我啓動應用程序的同時,我啓動了一個查詢Web服務的異步任務,並更新了我的本地JSON文件。然後我再次解析這些文件,我想通知所有已啓動的列表視圖,他們必須刷新其數據。我真的不知道該怎麼做。
這裏是我的異步任務的代碼
class UpdateTask extends AsyncTask{
@Override
protected Object doInBackground(Object... params) {
// Gets all the JSON Files and save them in local
mJsonClient.loadDistantJSON();
// Updates the cache maps and lists
fillsMaps();
fillsLists();
return null;
}
protected void onPostExecute(Object downloadReturn) {
// Notify the listviews
;
}
}
在其他活動包含一個ListView,我訪問緩存列表地方像一個靜態的方式:
myAdapter = new MyBaseAdapter(this,
SplashScreen.list,listview);
我如果你願意,我會很樂意提供更多的細節。
謝謝