diff --git a/samples/ApiDemos/res/layout/alert_dialog.xml b/samples/ApiDemos/res/layout/alert_dialog.xml
index 0097e7a16..9c6e4a3ed 100644
--- a/samples/ApiDemos/res/layout/alert_dialog.xml
+++ b/samples/ApiDemos/res/layout/alert_dialog.xml
@@ -29,6 +29,9 @@
+
diff --git a/samples/ApiDemos/res/values/strings.xml b/samples/ApiDemos/res/values/strings.xml
index f02718d35..c7fdf70e4 100644
--- a/samples/ApiDemos/res/values/strings.xml
+++ b/samples/ApiDemos/res/values/strings.xml
@@ -370,6 +370,7 @@
App/Dialog
OK Cancel dialog with a message
OK Cancel dialog with a long message
+ OK Cancel dialog with ultra long message
List dialog
Single choice list
Repeat alarm
@@ -391,6 +392,44 @@
kipg naar mixent phona. Cak pwico siructiun
ruous nust apoply tyu cak Uhex sisulutiun munityuw uw dseg
+
+ Plloaso mako nuto siwuf cakso dodtos anr koop a
+ cupy uf cak vux noaw yerw phuno. Whag schengos, uf efed, quiel
+ ba mada su otrenzr.\n\nSwipontgwook proudgs hus yag su ba dagarmidad.
+ Plasa maku noga wipont trenzsa schengos ent kaap zux comy.\n\nWipont trenz
+ kipg naar mixent phona. Cak pwico siructiun
+ ruous nust apoply tyu cak Uhex sisulutiun munityuw uw dseg\n\n
+ Plloaso mako nuto siwuf cakso dodtos anr koop a
+ cupy uf cak vux noaw yerw phuno. Whag schengos, uf efed, quiel
+ ba mada su otrenzr.\n\nSwipontgwook proudgs hus yag su ba dagarmidad.
+ Plasa maku noga wipont trenzsa schengos ent kaap zux comy.\n\nWipont trenz
+ kipg naar mixent phona. Cak pwico siructiun
+ ruous nust apoply tyu cak Uhex sisulutiun munityuw uw dseg\n\n
+ Plloaso mako nuto siwuf cakso dodtos anr koop a
+ cupy uf cak vux noaw yerw phuno. Whag schengos, uf efed, quiel
+ ba mada su otrenzr.\n\nSwipontgwook proudgs hus yag su ba dagarmidad.
+ Plasa maku noga wipont trenzsa schengos ent kaap zux comy.\n\nWipont trenz
+ kipg naar mixent phona. Cak pwico siructiun
+ ruous nust apoply tyu cak Uhex sisulutiun munityuw uw dseg\n\n
+ Plloaso mako nuto siwuf cakso dodtos anr koop a
+ cupy uf cak vux noaw yerw phuno. Whag schengos, uf efed, quiel
+ ba mada su otrenzr.\n\nSwipontgwook proudgs hus yag su ba dagarmidad.
+ Plasa maku noga wipont trenzsa schengos ent kaap zux comy.\n\nWipont trenz
+ kipg naar mixent phona. Cak pwico siructiun
+ ruous nust apoply tyu cak Uhex sisulutiun munityuw uw dseg\n\n
+ Plloaso mako nuto siwuf cakso dodtos anr koop a
+ cupy uf cak vux noaw yerw phuno. Whag schengos, uf efed, quiel
+ ba mada su otrenzr.\n\nSwipontgwook proudgs hus yag su ba dagarmidad.
+ Plasa maku noga wipont trenzsa schengos ent kaap zux comy.\n\nWipont trenz
+ kipg naar mixent phona. Cak pwico siructiun
+ ruous nust apoply tyu cak Uhex sisulutiun munityuw uw dseg\n\n
+ Plloaso mako nuto siwuf cakso dodtos anr koop a
+ cupy uf cak vux noaw yerw phuno. Whag schengos, uf efed, quiel
+ ba mada su otrenzr.\n\nSwipontgwook proudgs hus yag su ba dagarmidad.
+ Plasa maku noga wipont trenzsa schengos ent kaap zux comy.\n\nWipont trenz
+ kipg naar mixent phona. Cak pwico siructiun
+ ruous nust apoply tyu cak Uhex sisulutiun munityuw uw dseg\n\n
+
OK
Hide
Something
diff --git a/samples/ApiDemos/src/com/example/android/apis/app/AlertDialogSamples.java b/samples/ApiDemos/src/com/example/android/apis/app/AlertDialogSamples.java
index 67141751b..057e20ce2 100644
--- a/samples/ApiDemos/src/com/example/android/apis/app/AlertDialogSamples.java
+++ b/samples/ApiDemos/src/com/example/android/apis/app/AlertDialogSamples.java
@@ -64,6 +64,7 @@ public class AlertDialogSamples extends Activity {
private static final int DIALOG_MULTIPLE_CHOICE = 6;
private static final int DIALOG_TEXT_ENTRY = 7;
private static final int DIALOG_MULTIPLE_CHOICE_CURSOR = 8;
+ private static final int DIALOG_YES_NO_ULTRA_LONG_MESSAGE = 9;
private static final int MAX_PROGRESS = 100;
@@ -115,6 +116,30 @@ public class AlertDialogSamples extends Activity {
}
})
.create();
+ case DIALOG_YES_NO_ULTRA_LONG_MESSAGE:
+ return new AlertDialog.Builder(AlertDialogSamples.this)
+ .setIcon(R.drawable.alert_dialog_icon)
+ .setTitle(R.string.alert_dialog_two_buttons_msg)
+ .setMessage(R.string.alert_dialog_two_buttons2ultra_msg)
+ .setPositiveButton(R.string.alert_dialog_ok, new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int whichButton) {
+
+ /* User clicked OK so do some stuff */
+ }
+ })
+ .setNeutralButton(R.string.alert_dialog_something, new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int whichButton) {
+
+ /* User clicked Something so do some stuff */
+ }
+ })
+ .setNegativeButton(R.string.alert_dialog_cancel, new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int whichButton) {
+
+ /* User clicked Cancel so do some stuff */
+ }
+ })
+ .create();
case DIALOG_LIST:
return new AlertDialog.Builder(AlertDialogSamples.this)
.setTitle(R.string.select_dialog)
@@ -277,6 +302,15 @@ public class AlertDialogSamples extends Activity {
});
+ /* Display an ultra long text message with yes/no buttons and handle each message as well as the cancel action */
+ Button twoButtons2UltraTitle = (Button) findViewById(R.id.two_buttons2ultra);
+ twoButtons2UltraTitle.setOnClickListener(new OnClickListener() {
+ public void onClick(View v) {
+ showDialog(DIALOG_YES_NO_ULTRA_LONG_MESSAGE);
+ }
+ });
+
+
/* Display a list of items */
Button selectButton = (Button) findViewById(R.id.select_button);
selectButton.setOnClickListener(new OnClickListener() {