Android.App.AlertDialog Class
A subclass of Dialog that can display one, two or three buttons.

See Also: AlertDialog Members

Syntax

[Android.Runtime.Register("android/app/AlertDialog", DoNotGenerateAcw=true)]
public class AlertDialog : Dialog, IDisposable

Remarks

A subclass of Dialog that can display one, two or three buttons. If you only want to display a String in this dialog box, use the setMessage() method. If you want to display a more complex view, look up the FrameLayout called "custom" and add your view to it:

java Example

 FrameLayout fl = (FrameLayout) findViewById(android.R.id.custom);
 fl.addView(myView, new LayoutParams(MATCH_PARENT, WRAP_CONTENT));
 

The AlertDialog class takes care of automatically setting Android.Views.WindowManagerLayoutParams.FLAG_ALT_FOCUSABLE_IM for you based on whether any views in the dialog return true from Android.Views.View.OnCheckIsTextEditor. Generally you want this set for a Dialog without text editors, so that it will be placed on top of the current input method UI. You can modify this behavior by forcing the flag to your desired mode after calling AlertDialog.onCreate(android.os.Bundle).

Developer Guides

For more information about creating dialogs, read the Dialogs developer guide.

[Android Documentation]

Requirements

Namespace: Android.App
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1