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.
You can use a ProgressDialog whit a Handler.
Android Progress Dialog Example
Android's indeterminate ProgressDialog tutorial
Cheers
我觉得这个名字有点误导,但你应该在后台操作结束时显示一个ProgressBar 。
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 task setIndeterminate(true)
to enable the indeterminate mode onProgressUpdate()
to animate your progressbar to let the user know some work is being done incrementProgressBy(
) for increment progressbar content by a specific value doInBackground()
and do the background work here InterruptedException
object to find end of background operation onPostExecute()
to denote the end of operation and show the result
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.