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

This code example shows how to use the following methods: getContext, loadDataWithBaseURL, setBackgroundColor, setWebViewClient
	} 
	 
	 
    private void setup(){ 
    	 
    	String source = getSource(wv.getContext());
    	String html = source.replace("@src", url).replace("@color", Integer.toHexString(color));
    	 
    	wv.setWebViewClient(this);
    	 
    	//wv.setInitialScale(100); 
    	wv.loadDataWithBaseURL(null, html, "text/html", "utf-8", null);
    	wv.setBackgroundColor(color);
    	 
    } 
	 
    private void done(WebView view){
    	if(progress != null){
			//progress.setVisibility(View.GONE); 
			view.setVisibility(View.VISIBLE);
Full Snippet Info
8
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: loadDataWithBaseURL, setBackgroundColor, setScrollBarStyle
	 * @param context 
	 * @param html 
	 */ 
	public static void showHtml(final Context context, final String html) {
		AlertDialog.Builder moreDetailsDialog = null;
		final WebView webView = new WebView(context);
		final ScrollView scrollView = new ScrollView(context);
 
		webView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
		webView.setBackgroundColor(Color.WHITE);
		webView.loadDataWithBaseURL("fake://not/needed", html, "text/html", "UTF-8", null); // Encoding
																							// fix 
																							// for 
																							// Android 
																							// 3.x 
																							// / 
																							// 4.x 
		scrollView.addView(webView);
 
		moreDetailsDialog = new AlertDialog.Builder(context);
Full Snippet Info
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: getContext, loadDataWithBaseURL, setBackgroundColor, setWebViewClient
	} 
	 
	 
    private void setup(){ 
    	 
    	String source = getSource(wv.getContext());
    	String html = source.replace("@src", url).replace("@color", Integer.toHexString(color));
    	 
    	wv.setWebViewClient(this);
    	 
    	//wv.setInitialScale(100); 
    	wv.loadDataWithBaseURL(null, html, "text/html", "utf-8", null);
    	wv.setBackgroundColor(color);
    	 
    } 
	 
    private void done(WebView view){
    	if(progress != null){
			//progress.setVisibility(View.GONE); 
			view.setVisibility(View.VISIBLE);
Full Snippet Info
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: layout, getSettings, loadDataWithBaseURL, setWebViewClient
     legendLayoutparams.addRule(RelativeLayout.ALIGN_PARENT_TOP, RelativeLayout.TRUE);
     legendLayoutparams.setMargins(15, 15, 0, 0);
     legendLayout.setLayoutParams(legendLayoutparams);
      
     // now create the webview itself, and add to legendView 
     WebView webView = new WebView(activity);
     webView.getSettings().setJavaScriptEnabled(true);
     // force to open any URLs in native browser instead of WebView  
     webView.setWebViewClient(new WebViewClient() {
           @Override 
           public boolean shouldOverrideUrlLoading(WebView view, String url) {
              return super.shouldOverrideUrlLoading(view, url);
           } 
       }); 
     webView.layout(0, 0, 320, 300);
     webView.loadDataWithBaseURL("file:///android_asset/",HTML_HEAD+html+HTML_FOOT, "text/html", "UTF-8",null);
     legendLayout.addView(webView);
      
     mainLayout.addView(legendLayout);
 } 
} 
Full Snippet Info
8
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, loadDataWithBaseURL
	 
	public static void setWebPage(WebView wv, WebPage wp){
		 
		try{ 
			 
			wv.setVisibility(View.VISIBLE);
			 
			AQUtility.debug("load", wp.getUrl());
			wv.loadDataWithBaseURL(wp.getUrl(), wp.getHtml(), "text/html", "utf-8", null);
			 
		}catch(Exception e){
			AQUtility.report(e);
		} 
	} 
	 
	private static void setReady(ImageView imageView, WebPage wp){
    	 
		if(imageView == null || !wp.getOriginal().equals(imageView.getTag(AQuery.TAG_URL))){
			return; 
		} 
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related WebView loadDataWithBaseURL Questions & Answers:

loadDataWithBaseURL Method Overview
Loads the given data into this WebView, using baseUrl as the base URL for the content.
See Code Examples for other Android WebView Methods: