WebView clearCache - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for WebView clearCache method.

This code example shows how to use the following methods: clearDisappearingChildren, clearFocus, clearCache, clearFormData, clearHistory
This code example shows how to use the following methods: clearCache, loadUrl, stopLoading
    private void navigate(String url, int timeout) {
        if(url == null) {
            Log.v(LOGTAG, "URL is null, cancelling...");
            finish();
        } 
        webView.stopLoading();
        if(logTime) {
            webView.clearCache(true);
        } 
        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);
        } 
    } 
 
Full Snippet Info
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: clearCache, loadUrl, stopLoading
    private void navigate(String url, int timeout) {
        if(url == null) {
            Log.v(LOGTAG, "URL is null, cancelling...");
            finish();
        } 
        webView.stopLoading();
        if(logTime) {
            webView.clearCache(true);
        } 
        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);
        } 
    } 
 
Full Snippet Info
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: addJavascriptInterface, clearCache, clearFormData, clearHistory, getSettings
	 
    /** Called when the activity is first created. */ 
    @Override 
    public void onCreate(Bundle savedInstanceState) {
    	super.onCreate(savedInstanceState);
		webView = new WebView(this);
		setContentView(webView);
 
		webView.getSettings().setJavaScriptEnabled(true);
		webView.getSettings().setDomStorageEnabled(true);
		webView.getSettings().setGeolocationEnabled(true);
		webView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
		webView.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
		webView.clearHistory();
		webView.clearCache(true);
		webView.clearFormData();
 
		final Context myApp = this;
 
 

6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: setVisibility, clearCache, clearHistory, destroy
	@Override 
	protected void onDestroy() { 
		super.onDestroy(); 
 
		if (webViewer != null) {
			webViewer.setVisibility(View.GONE);
		    webViewer.clearCache(true);
		    webViewer.clearHistory();
		    webViewer.destroy();
		} 
	} 
 
	@Override 
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.ECLAIR
            && keyCode == KeyEvent.KEYCODE_BACK
            && event.getRepeatCount() == 0) {
            // Take care of calling this method on earlier versions of 
            // the platform where it doesn't exist. 
            onBackPressed(); 
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related WebView clearCache Questions & Answers:

clearCache Method Overview
Clears the resource cache.
See Code Examples for other Android WebView Methods: