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

Apps Listview inside a tab..?

naslundx

Lurker
So, this is for a normal Activity (min sdk version 7, target sdk version 15):

I have a Listview and a custom made Adapter connected to it.
This Listview is declared in an xml-file together with a TabHost. If the Listview is put directly in the layout and not in a tab, it works perfectly. But if I put it inside one of the tabs, it simply will not show.

Why can't I do this? Do I need to specify something special for the listview or the tabhost, or do I need to call some update/invalidate function on the tabhost after updating the list?
 
This is my xml-file:

[HIGH]
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<!--
IF I PUT THE LISTVIEW HERE, IT WORKS FINE
-->

<TabHost
android:id="@+id/tabhost"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true" >

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >

<TabWidget
android:id="@android:id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
</TabWidget>

<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<LinearLayout
android:id="@+id/tformulas"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<Button
android:id="@+id/tformulas_clear"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="B
 
Back
Top Bottom