views:

171

answers:

0

Hi all,

I have nested 2 ListView widgets inside a ViewFlipper:

<ViewFlipper android:id="@+id/flipper" android:layout_height="fill_parent" android:layout_width="fill_parent">
   <ListView android:id="@+id/bikeListView" android:layout_height="wrap_content" android:layout_width="fill_parent" />
   <ListView android:id="@+id/bikeComponentsListView" android:layout_height="wrap_content" android:layout_width="fill_parent" />
</ViewFlipper> 

I put a log at getView() method at my custom ListAdapter classes for the 2 ListView widgets and I discovered that when I move to next or previous view in ViewFlipper getView it is called even if ListView is not visible. For example, when I move from first ListView to the second one, getView() for the first one is called, although the second ListView is displayed.

Is this the expected behaviour? My intention is to use ViewFlipper and onFling to move back and forth in ViewFlipper and add many ListView inside ViewFlipper programmatically.

Thanks for reading my question.