package app.test;
import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebView;
public class Test extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
WebView upperView = (WebView)findViewById(R.id.upperview);
upperView.getSettings().setBuiltInZoomControls(true);
upperView.loadUrl("file:///android_asset/android.jpg");
WebView lowerView = (WebView)findViewById(R.id.lowerview);
String htmlString =
"Header
This is HTML text
Formatted in italics
";
lowerView.loadData(htmlString, "text/html", "utf-8");
}
}
//main.xml
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
android:id="@+id/upperview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
/>
android:id="@+id/lowerview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
/>