I need execute a long running task on my android application (network activity).
I use a new thread to do it.
This is working fine.
The problem is I need to update my sqlite database with the results of this process and I must not let the user do any UI interaction while I am doing this update.
I was thinking in use a ProgressDialog to force the user to wait. But what context to use on the creation of this ProgressDialog ?
The problem is I do not know what activity the user is using now. So I need some way of block the user interface who works in a global way.
You an
AsyncTaskwith aProgressDialog.Are you sure that this is the behavior you are looking for though? Do you really want to randomly pop up a dialog in the middle of the user’s task? This doesn’t sound like a great user experience. Ideally you would want to perform these operations w/o disrupting the user… are you sure this isn’t possible? (Maybe you can give more detailed info on this).