AndroidNativeCore.AlertDialog

Description

Android alert dialog is a small window with title and message that prompts the user to make a decision or enter additional information. This class invoke android AlertDialog with upto three buttons.

Contains:
Constents
int AlertDialog.THEME_TRADITIONAL

Traditional (pre-Holo) alert dialog theme.

int AlertDialog.THEME_HOLO_LIGHT

Holographic alert theme with a light background.

int AlertDialog.THEME_HOLO_DARK

Holographic alert theme with a dark background.

int AlertDialog.THEME_DEVICE_DEFAULT_LIGHT

Device's default alert theme with a dark background.

int AlertDialog.THEME_DEVICE_DEFAULT_DARK

Device's default alert theme with a light background.

Public Methods
AlertDialog

build(int Theme)

This Method take int as parametar for Dialog Theme you assign above Constent values only

AlertDialog setTitle(string title);

This method set title to AlertDialog by take string as parameter

AlertDialog setMessage(string message);

This method set Message to AlertDialog by take string as parameter

AlertDialog

setPositiveButtion(string text,dialogOnClick onClick)

This method set positive with string as name and onClick delegate as event handler

AlertDialog

setNegativeButtion(string text,onClick onClick)

This method set negative with string as name and onClick delegate as event handler

AlertDialog

setNeutralButtion(string text,dialogOnClick onClick)

This method set neutral buttion with string as name and onClick delegate as event handler

void

show()

This method display alert dialog with given configuration

Example
    
using AndroidNativeCore;

public void ShowAlert()
{
AlertDialog alertDialog = new AlertDialog();

alertDialog.build(AlertDialog.THEME_HOLO_DARK)
.setTitle("Hi")
.setMessage("This Jogi Prasad PAkki")
.setNegitiveButtion("Cansel",() => { Toast.show("NegitiveButtion", Toast.LENGTH_SHORT); })
.setPositiveButtion("Ok", () => { Toast.show("PositiveButtion", Toast.LENGTH_SHORT); })
.show();
}