org.hermit.android.notice
Class YesNoDialog

java.lang.Object
  extended by AlertDialog
      extended by org.hermit.android.notice.YesNoDialog

public class YesNoDialog
extends AlertDialog

This class implements a popup dialog box (a subclass of AlertDialog) which can be used to display a yes / no question.


Nested Class Summary
static interface YesNoDialog.OnOkListener
          Listener invoked when the user clicks the OK button.
 
Constructor Summary
YesNoDialog(Context parent, java.lang.CharSequence okBut, java.lang.CharSequence cancelBut)
          Create an error dialog.
YesNoDialog(Context parent, int okBut, int cancelBut)
          Create an error dialog.
 
Method Summary
 void setOnOkListener(YesNoDialog.OnOkListener listener)
          Set a listener for the dialog.
 void show(java.lang.CharSequence title, java.lang.CharSequence text)
          Start the dialog and display it on screen.
 void show(int title, int text)
          Start the dialog and display it on screen.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

YesNoDialog

public YesNoDialog(Context parent,
                   int okBut,
                   int cancelBut)
Create an error dialog.

Parameters:
parent - Parent application context.
okBut - The resource ID of the text for the OK button.
cancelBut - The resource ID of the text for the cancel button.

YesNoDialog

public YesNoDialog(Context parent,
                   java.lang.CharSequence okBut,
                   java.lang.CharSequence cancelBut)
Create an error dialog.

Parameters:
parent - Parent application context.
okBut - The text for the OK button.
cancelBut - The text for the cancel button.
Method Detail

setOnOkListener

public void setOnOkListener(YesNoDialog.OnOkListener listener)
Set a listener for the dialog.

Parameters:
listener - The listener to set.

show

public void show(int title,
                 int text)
Start the dialog and display it on screen. The window is placed in the application layer and opaque.

Parameters:
title - Title for the dialog.
text - Input prompt to display in the dialog.

show

public void show(java.lang.CharSequence title,
                 java.lang.CharSequence text)
Start the dialog and display it on screen. The window is placed in the application layer and opaque.

Parameters:
title - Title for the dialog.
text - Input prompt to display in the dialog.