开发者

addView in a ListView

In my application I want to use in my ListView items, which are different to each other.

Try to get an example.

I have an arraylist with actions, which do be executed.

Each action has starttime, endtime and the list of steps should be made to complete the action.

My idea was to setAdapter of my ListView with an ArrayAdapter 开发者_StackOverflow中文版filled with actions arraylist. And after that to add to each item dynamically textviews with step descriptions.

I do it in getView. As result scrolling throug list create new step descriptions.

How to avoid this?

Is to common that ListView has dynamic items?

Is it possible to create listview within listview?

Thank you


If you want to create ListView within another ListView, refer the expandable ListView in android dev guide

http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/ExpandableList1.html

http://developer.android.com/reference/android/widget/ExpandableListView.html

and also refer the endless adpater code in github

https://github.com/commonsguy/cwac-endless

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜