• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Adding content to TabLayout

Hi there,
I'm new to the forum so apologies if this in the wrong section, I browsed and think it's in the right spot...

My Question is regarding adding content to a tab layout view.

I've created 3 tabs, and want to view a different webpage in each.

The code I have for the tabs was taken from the tutorial, but I can't find a way to add the webview to the tabs...

I have:
mTabHost.addTab(mTabHost.newTabSpec("tab_test1").setIndicator("This will be the first tab").setContent(R.id.textview1));
mTabHost.addTab(mTabHost.newTabSpec("tab_test2").setIndicator("Second").setContent(R.id.textview2));
mTabHost.addTab(mTabHost.newTabSpec("tab_test3").setIndicator("Third").setContent(R.id.textview3));

But where / how do I add the following :S

setContentView(R.layout.main);
WebView webview = new WebView(this);
setContentView(webview);
webview.loadUrl("www.my webpage.com");

Thanks for any assistance!
 
Back
Top Bottom