You can certainly use a TabHost inside of a fragment.  TabHost is just a
view; it doesn't know anything about whatever is outside the view hierarchy
it is running in.

You haven't give the stack crawl of the exception, so it is hard to help
further.

On Mon, May 2, 2011 at 7:30 AM, Stephen <[email protected]> wrote:

> Having read the post here: http://goo.gl/6xYBD (Android 3.0-Tabhost)
> and based on the lack of a TabFragment it appears that the way to do
> things in 3.0 (and I guess above) is to use tabs in the action bar.
>
> My issue is that I'm writing an app that has the fairly standard
> 'listview on left, content on right' layout, and I'd like my content
> on the right to have tabs.  I know I can change the right fragment
> using the tabs in the action bar, but from a UI perspective, it just
> looks wrong.  The tabs in the action bar look like they preside over
> the *whole* application as they are above the left ListView as well.
> For example, in the HoneycombGallery app, the Android/Balloons/
> Bikes.... tabs change both the ListView fragment and the content
> fragment.  Mine would only change which aspect of the content you're
> looking at.
>
> I tried inflating a TabHost into the fragment but I get
> NullPointerExceptions when I run TabSpec.setContent (that may be me
> doing something wrong - I'll have another run at debugging it but
> figured I'd ask this anyway).
>
> I hope that all makes sense.  If I need to explain better please let
> me know.  I'm very interested in how others are solving this problem
> since I think the 'listview | content' style is quite common.  At the
> moment, my alternatives are either to fake tabs with buttons
> (something I'd rather avoid) or to present menu buttons in the action
> bar to change what you're looking at.
>
> Thank you,
>
> Stephen
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> 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
>



-- 
Dianne Hackborn
Android framework engineer
[email protected]

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
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