Skip to content

Instantly share code, notes, and snippets.

Created June 28, 2014 18:56
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
AsyncTask to add views to FakeListView
private class AddViewsToFakeListTask extends AsyncTask<Void, View, Void>{
private ListAdapter adapter;
private LinearLayout view;
public AddViewsToFakeListTask(LinearLayout view, ListAdapter adapter){
this.view = view;
this.adapter = adapter;
protected void onPreExecute() {
protected Void doInBackground(Void... params) {
for(int i = 0; i < adapter.getCount(); i++){
publishProgress(adapter.getView(i, null, null));
return null;
protected void onProgressUpdate(View... values) {
protected void onPostExecute(Void aVoid) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment