供你参考,
public class SampleTask extends AsyncTask<Void, Void, Void> {
@Override
protected Void doInBackground(Void... params) {
// Do your Background process Eg.. some Parsing whatever it's, then paste you adapter initialization code
// Initialize your adapter as global
CustomAdapter sampleAdapter = new CustomAdapter(CurrentActivity.this,
R.id.ImageView01, <Your Arraylist/Array>);
return null;
}
@Override
protected void onPostExecute(Void result) {
super.onPostExecute(result);
// Here you set your adapter
listView.setAdapter(sampleAdapter);
}
@Override
protected void onPreExecute() {
// TODO Auto-generated method stub
super.onPreExecute();
}
}