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