Progress bar: I believe we all understand that there is a progress bar, then to the user will not cause, a long wait and feel their own program hangs, so, this small demo can also take a look at, then, then we come to see exactly how to achieve.
1.:
2. Layout Description:
1.textview Display progress bar
2.ProgressBar progress bar
3. Progress bar Configuration:
<progressbar
Android:id= "@+id/pb"
Style= "@android: Style/widget.progressbar.horizontal"
Android:layout_width= "Match_parent"
android:layout_height= "Wrap_content"
android:max= "/> "
Where: Max can be set manually, that is, the size of the content you downloaded, style is
3. Example source code:
4.dowork () method is a time-consuming operation of simulation, of course, you can also use other alternatives, such as: Download pictures on the Internet, downloaded, and then displayed and so on.
The above is the fruits of their own work, although small with mosquitoes, but also meat, hope to help everyone, thank you.
Android Horizontal progress bar Demo