This article describes the interactive dialog box of Android programming. Share it for your reference, as follows:
1. In the Android SDK, although there are many windows, some similar to Modelless windows and some similar to front-end Force Focus windows, the one that really has interactive functions is the AlertDialog dialogue window.
new (EX03_12.this) .setTitle(.app_about) .setMessage(.app_about_msg) .setPositiveButton(.str_ok, new () { public void onClick(DialogInterface dialoginterface, int i) { } }).show();
There is only one OK button here, and other buttons and icons can be added, which can be referred to the Android documentation.
2. When you mention AlertDialog, you will naturally think of Toast. Toast is a short message that can prompt for adjustment of volume and size. It is also a very useful Debug tool for programmers.
/*Use the system standard makeText() method to generate Toast message*/ ( EX04_03.this,String,Toast.LENGTH_LONG).show();
The third parameter can be LENGTH_LONG or LENGTH_SHORT. The former means a long time and the latter is shorter. Of course, you can also use the rewritten Toast object method to define the Layout displayed by Toast yourself.
For more information about Android related content, please check out the topic of this site:Android development introduction and advanced tutorial》、《Android debugging skills and solutions to common problems》、《Summary of the usage of basic Android components》、《Android View View Tips Summary》、《Android layout layout tips summary"and"Android control usage summary》
I hope this article will be helpful to everyone's Android programming design.