WebView clearHistory - 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 clearHistory 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: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
Connect your IDE to all the code out there  Get Codota for Java
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(); 
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:clearHistory
                //This is the generated POST page. 
                if (url.startsWith("what:")) return;
                 
                //This is the first real page. 
                //Remove the generated page from history. 
                mWebView.clearHistory();
                mFirstPageLoaded = true;
                activity.setTitleButtonEnabled("refresh", true);
                return; 
            } 
        } 
         
 
        @Override 
        public void onFormResubmission(WebView view, Message dontResend,
                Message resend) {
            // TODO Auto-generated method stub 
            //super.onFormResubmission(view, dontResend, resend); 
            resend.sendToTarget();
        } 
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:clearHistory
        if (LOGD_ENABLED) Log.d(LOGTAG, "onPageStarted()");
        if (view != null) {
            // Clear history of all previously visited pages. When the 
            // user visits a preloaded tab, the only item in the history 
            // list should the currently viewed page. 
            view.clearHistory();
        } 
    } 
 
    @Override 
    public void onPageFinished(Tab tab) {
        if (LOGD_ENABLED) Log.d(LOGTAG, "onPageFinished()");
        if (tab != null) {
            final WebView view = tab.getWebView();
            if (view != null) {
                // Clear history of all previously visited pages. When the 
                // user visits a preloaded tab. 
                view.clearHistory();
            } 
        } 
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:clearCache, clearHistory, clearView
     * 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);
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:requestFocus, setFocusable, setFocusableInTouchMode, clearCache, clearFormData
   
  private WebDriverWebView() {} 
 
  private static void initWebViewSettings(WebView view) {
    // Clearing the view 
    view.clearCache(true);
    view.clearFormData();
    view.clearHistory();
    view.clearView();
 
    view.requestFocus(View.FOCUS_DOWN);
    view.setFocusable(true);
    view.setFocusableInTouchMode(true);
 
    // Webview settings 
    WebSettings settings = view.getSettings();
    settings.setJavaScriptCanOpenWindowsAutomatically(true);
    settings.setSupportMultipleWindows(true);
    settings.setBuiltInZoomControls(true);
    settings.setJavaScriptEnabled(true);

5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:clearHistory
		 
		hist.setOnClickListener(new OnClickListener() {
			 
			@Override 
			public void onClick(View v) {
				browser.clearHistory();
			} 
		}); 
		 
	} 
 
} 
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:setHorizontalScrollBarEnabled, setVerticalScrollBarEnabled, clearCache, clearFormData, clearHistory
        mContent.addView(mTitle);
    } 
 
    @SuppressLint("SetJavaScriptEnabled") 
	private void setUpWebView() { 
        mWebView = new WebView(getActivity());
         
        mWebView.clearHistory();
		mWebView.clearFormData();
		mWebView.clearCache(true);
		 
        mWebView.setVerticalScrollBarEnabled(false);
        mWebView.setHorizontalScrollBarEnabled(false);
        mWebView.setWebViewClient(new StackWebViewClient());
         
        WebSettings settings = mWebView.getSettings();
		settings.setSavePassword			(false);
		settings.setSaveFormData			(false);
		settings.setJavaScriptEnabled		(true);
		settings.setSupportZoom				(false);

5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:clearCache, clearHistory
		loading.setTag(100);
		webview.addView(loading);
	} 
 
	private void clearAllCookies (){ // NOW NOT USED 
	    webview.clearCache(true);
	    webview.clearHistory();
	    CookieSyncManager cookieSyncMngr =
            CookieSyncManager.createInstance(getContext());
	    cookieSyncMngr.startSync();
        CookieManager cookieManager = CookieManager.getInstance();
        cookieManager.removeAllCookie();        
	    cookieManager.removeSessionCookie();
	    cookieSyncMngr.stopSync();	    
	} 
 
	public void invoke(String origin, boolean allow, boolean remember) {
		// TODO Auto-generated method stub 
		 
	}  
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java

Related WebView clearHistory Questions & Answers:

clearHistory Method Overview
Tells this WebView to clear its internal back/forward list.
See Code Examples for other Android WebView Methods: