I have time consuming function upload /* around 10 sec */. I am trying before start upload to show ProgressDialog and when upload finishes to dismiss ProgressDialog and I trying like
pd = ProgressDialog.show(Uploader.this,
"Connecting...", "Uploading",
true, false);
Uploader.this
.runOnUiThread(new Runnable() {
public void run() {
upload();
handler.sendEmptyMessage(0);
}
});
Problem is that Progress doesn't show for around 10s, only flashes, like it first upload and then call show and dismiss ( I tried to put show above thread, but it is the same ). What to do ? ( Upload is void function)