WebView getTitle - 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 getTitle method.

This code example shows how to use the following methods:canGoBack, getTitle
  } 
 
  private final class HelpClient extends WebViewClient {
    @Override 
    public void onPageFinished(WebView view, String url) {
      setTitle(view.getTitle());
      backButton.setEnabled(view.canGoBack());
    } 
 
    @Override 
    public boolean shouldOverrideUrlLoading(WebView view, String url) {
      if (url.startsWith("file")) {
        // Keep local assets in this WebView. 
        return false; 
      } else { 
        // Open external URLs in Browser. 
        startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
        return true; 
      } 
    } 
6
CodeRank
This code example shows how to use the following methods:getTitle
 
		@Override 
		public void onPageFinished(final WebView view, final String url) {
			super.onPageFinished(view, url);
			if (mActivity instanceof BaseActivity) {
				mActivity.setTitle(view.getTitle());
				((BaseActivity) mActivity).setSupportProgressBarIndeterminateVisibility(false);
			} 
		} 
 
		@Override 
		public void onPageStarted(final WebView view, final String url, final Bitmap favicon) {
			super.onPageStarted(view, url, favicon);
			if (mActivity instanceof BaseActivity) {
				((BaseActivity) mActivity).setSupportProgressBarIndeterminateVisibility(true);
			} 
		} 
 
		@TargetApi(Build.VERSION_CODES.FROYO)
		@Override 
6
CodeRank
This code example shows how to use the following methods:canGoBack, getTitle
  } 
 
  private final class HelpClient extends WebViewClient {
    @Override 
    public void onPageFinished(WebView view, String url) {
      setTitle(view.getTitle());
      backButton.setEnabled(view.canGoBack());
    } 
 
    @Override 
    public boolean shouldOverrideUrlLoading(WebView view, String url) {
      if (url.startsWith("file")) {
        // Keep local assets in this WebView. 
        return false; 
      } else { 
        // Open external URLs in Browser. 
        startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
        return true; 
      } 
    } 
6
CodeRank
This code example shows how to use the following methods:setEnabled, getTitle
 
        @Override 
        public void onPageFinished(WebView view, String url) {
            super.onPageFinished(view, url);
            if (getShowsDialog() && getDialog() != null && view != null)
                getDialog().setTitle(view.getTitle());
            else if (mTitle != null && view != null)
                mTitle.setText(view.getTitle());
            view.setEnabled(true);
        } 
    } 
 
    @Override 
    public void onClick(View v) {
        switch (v.getId()) {
            case android.R.id.button1:
                if (!getShowsDialog() && getActivity() instanceof OpenExplorer)
                    ((OpenExplorer)getActivity()).findViewById(R.id.frag_log).setVisibility(
                            View.GONE);
                dismiss();
6
CodeRank
This code example shows how to use the following methods:getTitle
			return true; 
		} 
 
		@Override 
		public void onPageFinished(WebView view, String url) {
			header.setText(view.getTitle());
		} 
	} 
 
	/** Called when the activity is first created. */ 
	@Override 
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(viewId);
 
		header = (TextView) findViewById(R.id.help_header);
		helpBrowser = (WebView) findViewById(R.id.help_browser);
		helpBrowser.setWebViewClient(new Client());
		helpBrowser.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
		helpBrowser.setBackgroundColor(Color.BLACK);
6
CodeRank
This code example shows how to use the following methods:canGoBack, getTitle
        } 
 
        @Override 
        public void onPageFinished(WebView view, String url) {
            setProgressBarIndeterminateVisibility(false);
            setTitle(view.getTitle());
            backButton.setEnabled(view.canGoBack());
        } 
 
        @Override 
        public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
            Util.toast(HelpActivity.this, description);
        } 
    } 
} 
6
CodeRank
This code example shows how to use the following methods:getTitle
        } 
 
        @Override 
        public void onPageFinished(WebView view, String url) {
            super.onPageFinished(view, url);
            String title = mWebView.getTitle();
            if (title != null && title.length() > 0) {
                mTitle.setText(title);
            } 
            mSpinner.dismiss();
        } 
 
    } 
} 
5
CodeRank
This code example shows how to use the following methods:canGoBack, getTitle
  } 
 
  private final class HelpClient extends WebViewClient {
    @Override 
    public void onPageFinished(WebView view, String url) {
      setTitle(view.getTitle());
      backButton.setEnabled(view.canGoBack());
    } 
 
    @Override 
    public boolean shouldOverrideUrlLoading(WebView view, String url) {
      if (url.startsWith("file")) {
        // Keep local assets in this WebView. 
        return false; 
      } else { 
        // Open external URLs in Browser. 
        startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
        return true; 
      } 
    } 
5
CodeRank
This code example shows how to use the following methods:getTitle
            int id = res.getIdentifier("loading", "string", context.getPackageName());
            this.title.setText(context.getString(id));
        } 
         
        public void onPageFinished(WebView view, String url) {
        	this.title.setText(view.getTitle());
        } 
 
        /** 
         * Notify the host application that a page has started loading. 
         *  
         * @param view          The webview initiating the callback. 
         * @param url           The url of the page. 
         */ 
        @Override 
        public void onPageStarted(WebView view, String url,  Bitmap favicon) {
            super.onPageStarted(view, url, favicon);            
            String newloc;
            if (url.startsWith("http:")) {
                newloc = url;
5
CodeRank
This code example shows how to use the following methods:canGoBack, getTitle
  } 
 
  private final class HelpClient extends WebViewClient {
    @Override 
    public void onPageFinished(WebView view, String url) {
      setTitle(view.getTitle());
      backButton.setEnabled(view.canGoBack());
    } 
 
    @Override 
    public boolean shouldOverrideUrlLoading(WebView view, String url) {
      if (url.startsWith("file")) {
        // Keep local assets in this WebView. 
        return false; 
      } else { 
        // Open external URLs in Browser. 
        startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
        return true; 
      } 
    } 
4
CodeRank

Related WebView getTitle Questions & Answers:

getTitle Method Overview
Gets the title for the current page.
See Code Examples for other Android WebView Methods: