开发者

Creation "Loading Screen" for Android

I parse the .html page and take set of checkbox, than I add checkboxes to layout and setContentView(layout). But parsing is slow, and I want to create loading window during data is loading. I don't know how to do it, help me please. 开发者_如何学CThank you for, anyway.


For that you can implement AsyncTask (Painless Threading), implement ProgressBar inside the onPreExecute() method of AsyncTask.

As i have marked it is known as Painless Threading as we developer need not to bother about to start/pause/stop the thread, it is managed by Android itself.

Update:

You can also show ProgressDialog inside the onPreExecute() method and then hide the same in onPostExecute() method. For the same, i suggest you to go through this article, really helpful: https://sites.google.com/site/androidhowto/how-to-1/asynctasks-with-progressdialogs


You can do this using a progress dialog. There is a tutorial on the Android Developers Website, and this is where It starts to explain:

A ProgressDialog is an extension of the AlertDialog class that can display a progress animation in the form of a spinning wheel, for a task with progress that's undefined, or a progress bar, for a task that has a defined progression. The dialog can also provide buttons, such as one to cancel a download.

The Link is here: http://developer.android.com/guide/topics/ui/dialogs.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜