Android Frame Animation

Source: Internet
Author: User

To create a custom dialog box:

//Dialog BuilderBuilder Builder =NewAlertdialog.builder ( This);//Create an empty dialog boxFinal Alertdialog Dialog =builder.create ();//loading a custom view layoutView view = View.inflate ( This, R.layout.custom_dialog,NULL);intViewspacingleft =0;intViewspacingtop =0;intViewspacingright =0;intViewspacingbottom =0;//Specify a custom layout file for the dialog box, and the upper and lower left border is 0: otherwise the dialog box will appear black box, because the lower version of the dialog box, do not specify the background is black. Dialog.setview (view, Viewspacingleft, Viewspacingtop, Viewspacingright, viewspacingbottom);//Find button, set click eventButton Btn_login =(Button) View.findviewbyid (R.id.btn_login); Button Btn_cancel=(Button) View.findviewbyid (r.id.btn_cancel); Btn_login.setonclicklistener (NewView.onclicklistener () {@Override Public voidOnClick (View v) {toast.maketext (Getapplicationcontext (),"Make sure the button is clicked", Toast.length_short). Show ();    Dialog.dismiss (); }}); Btn_cancel.setonclicklistener (NewView.onclicklistener () {@Override Public voidOnClick (View v) {toast.maketext (Getapplicationcontext (),"the Cancel button is clicked", Toast.length_short). Show ();    Dialog.dismiss (); }});//Show dialog BoxDialog.show ();

Android Frame Animation

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.