Reputation: 9634
i am making lot of HTTP calls in my applications & switches between the views, now i'm handling the Http calls in a thread, but i want to make user to wait when the http request in progress. How to do this?. I just need to show a wait cursor or loading string.
Upvotes: 1
Views: 2391
Reputation: 2785
May be this will helpful. You have to make a background operation using thread concept like AsyncTask
. Using this you can hide the actual work from the UI part. And AsyncTask will get unallocated after your operations are completed.
AsyncTask
onPreExecute()
to initialize tasksetIndeterminate(true)
to enable the indeterminate modeonProgressUpdate()
to animate your progressbar to let the user know some work is being doneincrementProgressBy(
) for increment progressbar content by a specific valuedoInBackground()
and do the background work hereInterruptedException
object to find end of background operationonPostExecute()
to denote the end of operation and show the resultUpvotes: 0
Reputation: 3646
I find the name a bit misleading, but you should show a ProgressBar while background operations conclude.
Upvotes: 1
Reputation: 2482
You can use a ProgressDialog whit a Handler.
Android Progress Dialog Example
Android's indeterminate ProgressDialog tutorial
Cheers
Upvotes: 3