Toast Information Prompt box
1Button bt1=(Button) Findviewbyid (r.id.tbt01);2Button bt2=(Button) Findviewbyid (r.id.tbt02);3Bt1.setonclicklistener (NewOnclicklistener () {4 Public voidOnClick (View v) {5Toast.maketext (Toast0. This, "button 1 short tip",6 toast.length_short). Show ();7 }8 });9Bt2.setonclicklistener (NewOnclicklistener () {Ten Public voidOnClick (View v) { OneToast.maketext (Toast0. This, "button 2 long Tip", A Toast.length_long). Show (); - } -});Informational Alert Box
Dialog (dialog box), Alertdialog (warning box)
1 protected voidonCreate (Bundle savedinstancestate) {2 Super. OnCreate (savedinstancestate);3 Setcontentview (r.layout.dialog);4BT =(Button) Findviewbyid (R.ID.DBT);5Bt.setonclicklistener (NewOnclicklistener () {6 Public voidOnClick (View v) {7Dialog dialog=NewAlertdialog.builder (Dialog0. This)8. Settitle ("Warning")//Set Title9. Setmessage ("The stock market is risky, investment needs to be cautious")//Display InformationTen. SetIcon (R.drawable.go)//set the displayed picture One. Create ();//Create Dialog ADialog.show ();//Show dialog Box - } -});Warning Box
Advanced Controls "Android 5"-Informational cue box, dialog box