WebView clearView - 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 clearView 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, clearView, getSettings, loadUrl, setBackgroundColor
		this.useTransparentBackground = useTransparentBackground;
	} 
 
	@Override 
	public View getView(final Context context) {
		WebView w = new WebView(context);
		w.getSettings().setBuiltInZoomControls(useDefaultZoomControls);
		if (useTransparentBackground)
			w.setBackgroundColor(0x00000000);
		w.getSettings().setJavaScriptEnabled(true);
 
		w.setWebChromeClient(new WebChromeClient() {
			public void onProgressChanged(WebView view, int progress) {
				onPageLoadProgress(progress * 100);
			} 
		}); 
 
		w.setWebViewClient(new WebViewClient() {
			public boolean shouldOverrideUrlLoading(WebView view, String url) {
				if (url != null && url.startsWith("market://")) {

6
CodeRank
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
This code example shows how to use the following methods:clearView, pauseTimers, stopLoading
	} 
 
	@Override 
	protected void onDestroy() { 
		if (browser != null) {
			browser.pauseTimers();
			browser.stopLoading();
			browser.clearView();
		} 
		super.onDestroy(); 
		if (DEBUG)
			Log.d("onDestroy", "destory");
	} 
 
	private void loadCode(boolean noReset) {
		if (GlobalConfig.codeTemp == null) { 
			InputStream inptemp = this.getResources().openRawResource(R.raw.htmltemp);
			Scanner aScanner = new Scanner(inptemp);
			StringBuffer tempBuffer = new StringBuffer();
			while (aScanner.hasNextLine()) {
5
CodeRank
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
This code example shows how to use the following methods:clearView, getSettings, loadData, loadUrl
	 
	private void setLayout() 
	{ 
		String html_str;
 
		webView.getSettings().setJavaScriptEnabled(true);
		webView.clearView();
		webView.loadUrl("about:blank");
		//scrView.scrollTo(0, 0); 
				 
		html_str = headtag+imagebulletinitem.getContents()+endtag;
		 
		try { 
			webView.loadData(html_str, "text/html", "utf-8");
			//scrView.scrollTo(0, 0); 
			scrView.fullScroll(View.FOCUS_UP);
			setTitle(intent_title+" : "+page+"Page");
		} catch(Exception e)
		{ 
			e.printStackTrace();
5
CodeRank
This code example shows how to use the following methods:setVisibility, clearView
	 
	private class WebTwitterClient extends WebViewClient {
		@Override 
		public boolean shouldOverrideUrlLoading(WebView view, String url) {
			if (url.startsWith(CallBackUrl)) {
				view.clearView();
				view.setVisibility(View.GONE);
				if (!url.contains("denied")) {
					try { 
						AppTwitter.Autoritzar(url);
					} catch (TwitterException e) {}
					usuariTwitter.setText(AppTwitter.ObtenirNomUsuari());
					estatTwitter.setText("Conectat");
					missatge.setText("Log in correcte!");
				} 
				else missatge.setText("Log in Incorrecte");
				return true; 
			} 
			return super.shouldOverrideUrlLoading(view, url);
		} 
5
CodeRank
This code example shows how to use the following methods:clearView, loadDataWithBaseURL
	@Override 
	public void updateJidelnicek() { 
 
		if (jidelnicek != null && !jidelnicek.isEmpty()) {
			if (webView != null) {
				webView.clearView();
 
				CssTyp css = prefferenceManager.getCssTyp();
				String styled = HtmlHelper.surroundHtml(jidelnicek, css);
				webView.loadDataWithBaseURL(base, styled, mime, encoding, null);
			} else { 
				//..webView je null 
				if (getActivity() == null) {
					Log.e(TAG, "WebView i getActivity() je NULL");
				} else { 
 
					AlertDialog.Builder bld = new AlertDialog.Builder(getActivity());
					bld
						.setMessage("WebView je null")
						.setPositiveButton("OK", null);
4
CodeRank
This code example shows how to use the following methods:clearView
This code example shows how to use the following methods:clearView
	} 
 
	@Override 
	public void onDestroy() { 
		if (content != null) {
			content.clearView();
		} 
		super.onDestroy(); 
	} 
 
//	@Override 
//	public void onPause() { 
//		super.onPause(); 
//	} 
	 
	 
 
	@Override 
	public void onStart() { 
		super.onStart(); 
4
CodeRank

Related WebView clearView Questions & Answers:

clearView Method Overview
This method was deprecated in API level 18. Use WebView.loadUrl("about:blank") to reliably reset the view state and release page resources (including any running JavaScript).
See Code Examples for other Android WebView Methods: