FileDocCategorySizeDatePackage
EditResponseHelper.javaAPI DocAndroid 1.5 API3227Wed May 06 22:42:42 BST 2009com.android.calendar

EditResponseHelper

public class EditResponseHelper extends Object implements DialogInterface.OnClickListener
A helper class for editing the response to an invitation when the invitation is a repeating event.

Fields Summary
private final android.app.Activity
mParent
private int
mWhichEvents
private android.app.AlertDialog
mAlertDialog
private DialogInterface.OnClickListener
mDialogListener
This callback is passed in to this object when this object is created and is invoked when the "Ok" button is selected.
private DialogInterface.OnClickListener
mListListener
This callback is used when a list item is selected
Constructors Summary
public EditResponseHelper(android.app.Activity parent)

    
       
        mParent = parent;
    
Methods Summary
public intgetWhichEvents()

        return mWhichEvents;
    
public voidonClick(android.content.DialogInterface dialog, int which)

    
public voidsetOnClickListener(DialogInterface.OnClickListener listener)

        mDialogListener = listener;
    
public voidshowDialog(int whichEvents)

    
        
        // We need to have a non-null listener, otherwise we get null when
        // we try to fetch the "Ok" button.
        if (mDialogListener == null) {
            mDialogListener = this;
        }
        AlertDialog dialog = new AlertDialog.Builder(mParent)
                .setTitle(R.string.change_response_title)
                .setIcon(android.R.drawable.ic_dialog_alert)
                .setSingleChoiceItems(R.array.change_response_labels, whichEvents,
                        mListListener)
                .setPositiveButton(android.R.string.ok, mDialogListener)
                .setNegativeButton(android.R.string.cancel, null)
                .show();
        mAlertDialog = dialog;
        
        if (whichEvents == -1) {
            // Disable the "Ok" button until the user selects which events to
            // delete.
            Button ok = dialog.getButton(DialogInterface.BUTTON_POSITIVE);
            ok.setEnabled(false);
        }