"Using ListActivity & ExpandableListActivity at the same in one tab
activity."
is just an example of crash in tabs.

The crash still happens when you use ListView and ExpandableListView
as the contents of the tabs, not activities.

Another example here. (I modified tabs1.xml from ApiDemos.)

    <ListView android:id="@+id/view1"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"/>

    <LinearLayout android:id="@+id/view2"
        android:background="@drawable/red"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent">
        <ListView android:id="@android:id/list"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"/>
    </LinearLayout>

    <LinearLayout android:id="@+id/view3"
        android:background="@drawable/blue"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent">
            <ExpandableListView android:id="@android:id/list"
                android:background="@drawable/green"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"/>
    </LinearLayout>

On Jan 21, 5:50 pm, "Mark Murphy" <[email protected]> wrote:
> > This means we cannot use ListActivity & ExpandableListActivit at the
> > same in one tab activity.
>
> Presumably not, if your analysis is correct, and I suspect it is.
>
> To get the visual effect you want, use ListView and ExpandableListView as
> the contents of the tabs, not activities. Then, you can provide them with
> unique widget IDs. You will save memory, save CPU time, save battery life,
> reduce the odds that you will encounter a StackOverflowException for
> having too complicated of a UI, and solve this problem, all at the same
> time.
>
> --
> Mark Murphy (a Commons Guy)http://commonsware.com
> Android App Developer Books:http://commonsware.com/books.html

-- 
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