Android UI [multi-option dialog box for Android custom Dialog]

Source: Internet
Author: User

A dialog box is displayed in the latest launcher project. Many of my friends asked meCodeSo today, I took some time to deduct this code and share it with you. "Please mark the source of your post and respect the author's Labor achievements." Right

 

I will not elaborate on the code here. Some unnecessary items are included in the project. The usage is as follows:

 public class mainactivity extends activity implements extends {public corpusselectiondialog alog; private list 
  
    mappcategorylist; @ overridepublic void oncreate (bundle savedinstancestate) {super. oncreate (savedinstancestate); setcontentview (R. layout. main); initdata (); button B = (button) This. findviewbyid (R. id. button1); B. setonclicklistener (New onclicklistener () {@ overridepublic void onclick (view v) {showcorpusselectiondialog () ;}}) ;}@ overridepublic void oncorpusselected (corpus) {toast. maketext (this, corpus. label + "clicked", toast. length_long ). show ();}/*** display custom dialog */protected void showcorpusselectiondialog () {If (mcorpusselectiondialog = NULL) {mcorpusselectiondialog = new categoryappdialog (this, mappcategorylist ); mcorpusselectiondialog. setowneractivity (this); mcorpusselectiondialog. setoncorpusselectedlistener (this);} mcorpusselectiondiener. show () ;}
  

source code: http://download.csdn.net/detail/lnb333666/4471241

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.