multithreading - Using AsyncTask to update UI in Android -
i'm trying use asynctask read 1000 lines sqlite. i'm using progressdialog show progress. working fine , when method onpostexecute() dismiss dialog , try update entire lines on main thread. dialog disappears ui takes lot update. during doinbackground() method, i'm filling tablelayout , return onpostexecute(). how can show progressdialog until main thread totally filled? private class filltable extends asynctask<void, integer, tablelayout>{ private file file; private progressdialog pleasewaitdialog; private context ctx; private int colcount; private int lincount; private scrollview scroolview; private sqlitedatabase db; private cursor cursor; public filltable(context context, string newquery){ ctx = context; scroolview = (scrollview)serviceactivity.this.findviewbyid(r.id.sv_service_vertical); file = new file(environment.getexternalstoragedirectory().getab