Code example for Handler

Methods: obtainMessagesendMessageDelayed

0
        startTime = System.currentTimeMillis();
        Log.v(LOGTAG, "Navigating to URL: " + url);
        webView.loadUrl(url);
 
        if(timeout != 0) {
            //set a timer with specified timeout (in ms) 
            handler.sendMessageDelayed(handler.obtainMessage(MSG_TIMEOUT),
                    timeout);
        } 
    } 
 
    @Override 
    protected void onDestroy() { 
        super.onDestroy(); 
        Log.v(LOGTAG, "onDestroy, inst=" + Integer.toHexString(hashCode()));
        webView.clearCache(true);
        webView.destroy();
    } 
 
    private boolean isPageDone() { 
        synchronized (pageDoneLock) {