Multiple ListViews in ViewFlipper do not load
I had 2 activities in a viewflipper with one activity and the other a listactivity. I loaded the list activity with setListAdapter and everything worked great.
I added a third activity inside a viewflipper in my main layout. This third ac开发者_StackOverflowtivity contains a listview just like my second activity. I switched the ListActivities to activities and load the listviews using setAdapter.
The list are empty when I run the application and swipe to the other activity in the viewflipper. If I place the listview in the main xml the listview populates just fine.
It appears the list is getting reset after the initial load.
I figured it out as soon as i hit post!
I had to remove the xml from the layout file.
<TextView android:id="@android:id/empty"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:background="#000000"
android:textColor="#FFFFFF"
android:textSize="20sp"
android:text="No contacts exists"/>
Since I changed to an Activity from a ListActivity this was overriding the listview and would display.
精彩评论