In Android, if the program prompts a small amount of messages and you do not need to perform any operations, you can use the lightweight message toast provided by Android.
Text prompt.
Message prompts with images
Use a toast instance.
Public class toasttest extends activity {@ overridepublic void oncreate (bundle savedinstancestate) {super. oncreate (savedinstancestate); setcontentview (R. layout. main); button simple = (button) findviewbyid (R. id. simple); // bind the event listener simple to the Click Event of the button. setonclicklistener (New onclicklistener () {@ overridepublic void onclick (View Source) {// create a toast prompt message Toast = toast. maketext (toasttest. this, "simple prompt information" // sets the toast message duration, toast. length_short); toast. show () ;}}); button bn = (button) findviewbyid (R. id. BN); // bind event listener bn to the Click Event of the button. setonclicklistener (New onclicklistener () {@ overridepublic void onclick (View Source) {// create a toast prompt message Toast = toast. maketext (toasttest. this, "prompt information with image" // sets the toast message duration, toast. length_long); toast. setgravity (gravity. center, 0, 0); // obtain the original viewview toastview = toast in the toast prompt. getview (); // create an imageviewimageview image = new imageview (toasttest. this); image. setimageresource (R. drawable. tools); // create a linearlayout container linearlayout LL = new linearlayout (toasttest. this); // Add images and original viewll to linearlayout. addview (image); LL. addview (toastview); toast. setview (LL); toast. show ();}});}}