org.hermit.android.notice
Class TextInputDialog

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

public class TextInputDialog
extends AlertDialog

This class implements a popup input box (a subclass of AlertDialog) which can be used to display a prompt and read a text string from the user.


Nested Class Summary
static interface TextInputDialog.OnOkListener
          Listener invoked when the user clicks the OK button.
 
Constructor Summary
TextInputDialog(Context parent, java.lang.CharSequence okBut, java.lang.CharSequence cancelBut)
          Create an error dialog.
TextInputDialog(Context parent, int okBut, int cancelBut)
          Create an error dialog.
 
Method Summary
 void setOnOkListener(TextInputDialog.OnOkListener listener)
          Set a listener for the dialog.
 void show(int title, int text)
          Start the dialog and display it on screen.
 void show(int title, int text, java.lang.String dflt)
          Start the dialog and display it on screen.
 void show(java.lang.String title, java.lang.String text)
          Start the dialog and display it on screen.
 void show(java.lang.String title, java.lang.String text, java.lang.String dflt)
          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

TextInputDialog

public TextInputDialog(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.

TextInputDialog

public TextInputDialog(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(TextInputDialog.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(int title,
                 int text,
                 java.lang.String dflt)
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.
dflt - Default text to display in the input field.

show

public void show(java.lang.String title,
                 java.lang.String 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.String title,
                 java.lang.String text,
                 java.lang.String dflt)
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.
dflt - Default text to display in the input field.