/** Caching user after it's retrieving. */ @Override protected void onPostExecute(FbUser result) { super.onPostExecute(result); adapter.cacheUser(result); // recursive call of an asynchronous task if (position < adapter.getCount() - 1) { new FetchDataTask(adapter, ++position).execute(); } }
/** Get LazyAdapter to work with. */ public FetchDataTask(LazyAdapter adapter, int position) { this.adapter = adapter; this.position = position; this.id = (String) adapter.getItem(position); }