Code example for ExecutionException

Methods: getCause

0
        getInstrumentation().runOnMainSync(task);
        try { 
            return task.get();
        } catch (ExecutionException e) {
            // Unwrap the cause of the exception and re-throw it. 
            throw e.getCause();
        } 
    } 
 
    protected void enableJavaScriptOnUiThread(final AwContents awContents) {
        getInstrumentation().runOnMainSync(new Runnable() {
            @Override 
            public void run() { 
                awContents.getContentViewCore().getContentSettings().setJavaScriptEnabled(true);
            } 
        }); 
    } 
 
    /** 
     * Loads url on the UI thread and blocks until onPageFinished is called. 
     */