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.