FileDocCategorySizeDatePackage
EditPinPreference.javaAPI DocAndroid 1.5 API2521Wed May 06 22:42:48 BST 2009com.android.settings

EditPinPreference

public class EditPinPreference extends android.preference.EditTextPreference
TODO: Add a soft dialpad for PIN entry.

Fields Summary
private boolean
mDialogOpen
private OnPinEnteredListener
mPinListener
Constructors Summary
public EditPinPreference(android.content.Context context, android.util.AttributeSet attrs)

        super(context, attrs);
    
public EditPinPreference(android.content.Context context, android.util.AttributeSet attrs, int defStyle)

        super(context, attrs, defStyle);
    
Methods Summary
public booleanisDialogOpen()

        return mDialogOpen;
    
protected voidonBindDialogView(android.view.View view)

        super.onBindDialogView(view);
        
        final EditText editText = (EditText) view.findViewById(android.R.id.edit);
        
        if (editText != null) {
            editText.setSingleLine(true);
            editText.setTransformationMethod(PasswordTransformationMethod.getInstance());
            editText.setKeyListener(DigitsKeyListener.getInstance());
        }
    
protected voidonDialogClosed(boolean positiveResult)

        super.onDialogClosed(positiveResult);
        mDialogOpen = false;
        if (mPinListener != null) {
            mPinListener.onPinEntered(this, positiveResult);
        }
    
public voidsetOnPinEnteredListener(com.android.settings.EditPinPreference$OnPinEnteredListener listener)

        mPinListener = listener;
    
public voidshowPinDialog()

        mDialogOpen = true;
        showDialog(null);