Android 21st Lesson--titlerogressbar

Source: Internet
Author: User

<Relativelayoutxmlns:android= "Http://schemas.android.com/apk/res/android"Xmlns:tools= "Http://schemas.android.com/tools"Android:layout_width= "Match_parent"Android:layout_height= "Match_parent">    <ButtonAndroid:id= "@+id/bn1"Android:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:layout_alignparentleft= "true"Android:layout_alignparenttop= "true"Android:text= "Display" />    <ButtonAndroid:id= "@+id/bn2"Android:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:layout_alignparenttop= "true"Android:layout_centerhorizontal= "true"Android:text= "hidden" />    </Relativelayout>
 PackageCom.example.titleprogressbar;Importandroid.app.Activity;ImportAndroid.os.Bundle;ImportAndroid.view.View;ImportAndroid.view.View.OnClickListener;ImportAndroid.view.Window;ImportAndroid.widget.Button; Public classMainactivityextendsActivity {@Overrideprotected voidonCreate (Bundle savedinstancestate) {Super. OnCreate (savedinstancestate); //Set the window feature to enable the progress bar showing progressrequestwindowfeature (window.feature_progress); //Set the window feature to enable a progress bar that does not show progressrequestwindowfeature (window.feature_indeterminate_progress);        Setcontentview (R.layout.activity_main); Button BN1=(Button) Findviewbyid (R.ID.BN1); Button BN2=(Button) Findviewbyid (R.ID.BN2); Bn1.setonclicklistener (NewOnclicklistener () {@Override Public voidOnClick (View v) {//Show progress bar without progressSetprogressbarindeterminatevisibility (true); //Show progress bar with ProgressSetprogressbarvisibility (true); //set progress for progress barSetprogress (4500);        }                    }); Bn2.setonclicklistener (NewOnclicklistener () {@Override Public voidOnClick (View v) {//hide the progress bar without progressSetprogressbarindeterminatevisibility (false); //Hide Progress bar with ProgressSetprogressbarvisibility (false);    }                    }); }}

Android 21st Lesson--titlerogressbar

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.