FileDocCategorySizeDatePackage
JsResult.javaAPI DocAndroid 1.5 API2289Wed May 06 22:41:56 BST 2009android.webkit

JsResult

public class JsResult extends Object

Fields Summary
private boolean
mReady
private boolean
mTriedToNotifyBeforeReady
protected boolean
mResult
protected final CallbackProxy
mProxy
private final boolean
mDefaultValue
Constructors Summary
JsResult(CallbackProxy proxy, boolean defaultVal)

        mProxy = proxy;
        mDefaultValue = defaultVal;
    
Methods Summary
public final voidcancel()
Handle the result if the user cancelled the dialog.

        mResult = false;
        wakeUp();
    
public final voidconfirm()
Handle a confirmation response from the user.

        mResult = true;
        wakeUp();
    
final booleangetResult()

        return mResult;
    
voidhandleDefault()

        setReady();
        mResult = mDefaultValue;
        wakeUp();
    
final voidsetReady()

        mReady = true;
        if (mTriedToNotifyBeforeReady) {
            wakeUp();
        }
    
protected final voidwakeUp()

        if (mReady) {
            synchronized (mProxy) {
                mProxy.notify();
            }
        } else {
            mTriedToNotifyBeforeReady = true;
        }