I came across this code in a very basic Handler tutorial. The code is working fine but I do not understand why I have to use Handler for progressDialog.dismiss()
progressDialog.dismiss()
The easier the better. Instead of using a handler, you could try to use the following code:
runOnUiThread( new Runnable() { public void run() { //Update user interface here } } );
Don't make your life to complicated ;)