Skip to content

Instantly share code, notes, and snippets.

@rajiv-singaseni
Created June 29, 2011 18:26
Show Gist options
  • Save rajiv-singaseni/1054518 to your computer and use it in GitHub Desktop.
Save rajiv-singaseni/1054518 to your computer and use it in GitHub Desktop.
An android activity to display HTML inline.
package com.webile.webviewdemo;
import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebView;
public class MainActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
WebView webView = new WebView(this);
setContentView(webView);
String debugHTML = "<img src='http://www.google.com/intl/en_ALL/images/logos/images_logo_lg.gif' />" ;
webView.loadDataWithBaseURL(null,debugHTML, "text/html", "UTF-8", "about:blank");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment