You should use a Service and call a Sub in the Main Activity to update the progress dialogue every 200th iteration of the loop or whatever looks best.
i am using a service but why do i need to update every x time the loop? i know i could do it with:
if i mod 200 then DoEvents
but i would like to have a progressdialog animation running when i start a process and until i finish it and not freeze because process is running in background.
the WHOLE point of a progressdialog is to give the user the filling that the app did not freeze while you perform a big process but what happens is that the progress dialog freezes by it self
to solve it with doevents inside a loop and make the loop like this very very slow is not a solution.
there need to be a RUN IN BACKGROUND solution where the app is not waiting until that task is finished.
you have such Background Tasks in VB.
i thought a service is running in background but using a service will still freeze the Progressdialog until the code in the Service is finished.
this does not make any sense to me, sorry