开发者

Multiple ListViews in ViewFlipper do not load

开发者 https://www.devze.com 2023-04-09 16:44 出处:网络
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 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号