public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.number6);
WebView webview1;
webview1 = (WebView) findViewById(R.id.webView1);
webview1.getSettings().setJavaScriptEnabled(true);
webview1.loadUrl("http://www.google.com");
WebView webview2;
webview2 = (WebView) findViewById(R.id.webView2);
webview2.getSettings().setJavaScriptEnabled(true);
webview2.loadUrl("http://www.daum.net");
TabHost tabHost = (TabHost)findViewById(R.id.tab_host);
tabHost.setup();
// Tab1 Setting
TabSpec tabSpec1 = tabHost.newTabSpec("Tab1");
tabSpec1.setIndicator("구글"); // Tab Subject
tabSpec1.setContent(R.id.tab_view1); // Tab Content
tabHost.addTab(tabSpec1);
// Tab2 Setting
TabSpec tabSpec2 = tabHost.newTabSpec("Tab2");
tabSpec2.setIndicator("다음"); // Tab Subject
tabSpec2.setContent(R.id.tab_view2); // Tab Content
tabHost.addTab(tabSpec2);
// show First Tab Content
tabHost.setCurrentTab(0);
}
/*
@Override
xml은
<LinearLayout
android:id="@+id/tab_view1"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<WebView android:id="@+id/webView1"
android:layout_width="match_parent"
android:layout_height="match_parent">
</WebView>
</LinearLayout>
<LinearLayout
android:id="@+id/tab_view2"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<WebView android:id="@+id/webView2"
android:layout_width="match_parent"
android:layout_height="match_parent">
</WebView>
</LinearLayout>
구글은 자꾸 전체페이지로 넘어갑니다.
근데 다음은 웹뷰 페이지에 보여집니다.
무가 문제일까요