Small Android progress bar instance

Source: Internet
Author: User

Describe a button control in mainactivity, write a click event, and jump to another progressbaractivity. An example of using a progress bar in progressbaractivity is as follows:

Create the ss_bar.xml layout management file in the layout folder, and register the page in androidmanifest. xml.

Write the code in progress_bar.xml:

<Linearlayout xmlns: Android = "http://schemas.android.com/apk/res/android"
Android: Orientation = "vertical"
Android: layout_width = "fill_parent"
Android: layout_height = "fill_parent"
>
<Textview
Android: layout_width = "wrap_content"
Android: layout_height = "wrap_content"
Android: text = "graphic progress bar"
/>
<Progressbar
Android: Id = "@ + ID/progress_bar"
Android: layout_height = "wrap_content"
Android: layout_width = "wrap_content"
/>

<Textview
Android: layout_width = "wrap_content"
Android: layout_height = "wrap_content"
Android: text = "Horizontal progress bar"
/>
<Progressbar
Android: Id = "@ + ID/progress_horizontal"
Style = "? Android: ATTR/progressbarstylehorizontal"
Android: layout_height = "wrap_content"
Android: layout_width = "200dip"
Android: max = "100"
Android: Progress = "50"
Android: secondaryprogress = "75"
/>
</Linearlayout>

 

Associate the activity with the description file in progressbaractivity.

You can see the initial results after running.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.