package app.test;
import android.app.Activity;
import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.webkit.WebView;
import android.widget.TabHost;
class AndroidBrowser extends Activity {
WebView browser;
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
browser = new WebView(this);
setContentView(browser);
browser.loadUrl("http://www.android.com/");
}
}
class CWBrowser extends Activity {
WebView browser;
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
browser = new WebView(this);
setContentView(browser);
browser.loadUrl("http://rntsoft.com");
}
}
public class Test extends TabActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
TabHost host = getTabHost();
host.addTab(host.newTabSpec("one").setIndicator("CW")
.setContent(new Intent(this, CWBrowser.class)));
host.addTab(host.newTabSpec("two").setIndicator("Android")
.setContent(new Intent(this, AndroidBrowser.class)));
}
}
//main.xml
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Hello World, IntentTabDemo"
/>