I want to display ProgressDialog while listview is loading. I’ve already tried like following coding but it didn’t work.
final ProgressDialog dialog = ProgressDialog.show(this, "indeterminate", "Please wait while loading", true);
final Handler handler = new Handler() {
public void handleMessage(Message msg) {
dialog.dismiss();
}
};
Thread checkUpdate = new Thread() {
public void run() {
// listview will be populated here
PopulateListView();
handler.sendEmptyMessage(0);
}
};
checkUpdate.start();
But it didn’t work at all.
ppshein… I think you are missing a few calls.
I have working code here.
Also AsyncTask here.