I have the following in my main activity:
private void attemptLogin() {
this.runOnUiThread(new Runnable() {
@Override
public void run() {
dialog = ProgressDialog.show(cntxt, "", "Loading...", true);
}
});
// continue...
}
However the dialog does not appear, either on a device or the simulator, for a long time, until after my login process is complete (by which time it gets dismissed anyway).
Why is that, and how do I fix it?
Just to let you know how runOnUIThread() works is that,
It starts when your activity is finished with the default UIThread it has, and then the runOnUIThread() will be called. so if you have running something in your activity, this will not appear.
I would suggest you to use AsyncTasks.. since you haven’t posted any code, all my suggestions are based on the assumption that you are running something in your activity.