I'm not sure where I can post the project file. But from a new
project, all you need is these two files, which is probably just as
quick to implement:
// Main Java file
package com.android.test;
import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebView;
public class SampleWebviewActivity extends Activity {
WebView webview;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
webview = (WebView) findViewById(R.id.webview);
final String mimeType = "text/html";
final String encoding = "utf-8";
webview.loadData("<ul><li>3</li><li>O2</li><li>Orange</
li><li> T-Mobile</li><li> Virgin</li><li></li></ul>",
mimeType, encoding);
}
}
// XML layout
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/
android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<WebView android:id="@+id/webview"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
</LinearLayout>
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en