mscwd01 wrote:
> The "content" I wish to include in each tab are WebViews, I hadn't
> really thought about it but I may be able to achieve what I want
> without using intent-based tab content.

Absolutely!

> Just out of interest, my Activity is getting rather large, is there a
> way to define a WebView in a different class from the one creating the
> TabHost and just reference the WebView (from its individual class)
> when inserting it as content to the tab?

Sure!

Well, OK, it depends on how you define "define".

TabHost#addTab() takes a TabSpec, which wants a widget ID from the 
layout for the tab activity.

But, what you can do is create MyNeatoWebViewWrapper class that takes a 
WebView in the constructor and houses all your WebView-specific logic, 
such as your WebViewClient instances and such. In your TabActivity, you 
would use findViewById() to get the WebView to hand to 
MyNeatoWebViewWrapper, and use the same widget ID in the TabSpec.

There are probably other patterns here as well; this is just one off the 
top of my head.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com

Android Training on the Ranch! -- Mar 16-20, 2009
http://www.bignerdranch.com/schedule.shtml

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to