Code example for WebView

Methods: clearCacheclearHistoryclearView

0
     * Clears browsers of all data. Super finishes. 
     */ 
    @Override 
    public void finish() { 
        Log.v(TAG, "finishing");
        webview.clearCache(true);
        webview.clearView();
        webview.clearHistory();
        super.finish(); 
    } 
 
    /** 
     * Sets the browser settings so that we don't save anything unnecessary and the beddit login page is shown nicely. 
     */ 
    private void setSettings() { 
        // Here we set various settings regarding browser experience. 
        WebSettings settings = webview.getSettings();
        webview.setInitialScale(1);
        settings.setSavePassword(false);
        settings.setCacheMode(WebSettings.LOAD_NO_CACHE);
        settings.setAppCacheEnabled(false);