Hi everyone,

I've been trying to update my app and get going with fragments, the
action bar, and all the other UI features that I'm missing out on.  I
understand I can have multiple fragments in an activity, have
different layouts based upon the device and all that good stuff but
I'm struggling with getting some tab stuff the way I want.  I
understand how to add tabs, switching between them but how do I have
more than one fragment in a tab? So for example I have essentially two
screens I want the user to be able to switch back and forth from
easily (why I want to use tabs).  If I have two separate activities I
can specify this in xml files and use setContentView using the layouts
below

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/
android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >
    <fragment
        android:name="com.example.tabrefactor.Fragment1"
        android:id="@+id/fragment_1"
        android:layout_height="wrap_content"
        android:layout_width="wrap_content"/>
    <fragment
        android:name="com.example.tabrefactor.Fragment2"
        android:id="@+id/fragment_2"
        android:layout_height="wrap_content"
        android:layout_width="wrap_content"/>
    <fragment
        android:name="com.example.tabrefactor.Fragment3"
        android:id="@+id/fragment_3"
        android:layout_height="wrap_content"
        android:layout_width="wrap_content"/>
</LinearLayout>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/
android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >
    <fragment
        android:name="com.example.tabrefactor.Fragment4"
        android:id="@+id/fragment_4"
        android:layout_height="wrap_content"
        android:layout_width="wrap_content"/>
</LinearLayout>

I can convert the second layout to using tabs since its only contains
one fragment but I'm not sure how get the first layout into a single
tab.  Is that something that's allowed? Thanks in advance,

Jason Prenger

-- 
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
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to