开发者

Android: viewing tabular data

In android, there is the ListActivity. However, what if I want multiple lists in the same Activity? For instance:

Vehicles [Add Vehicle]

1999 Fo开发者_运维技巧rd Focus

2001 Nissan Altima

Drivers [Add Driver]

John Doe

Jane Doe

How would I create a view like what you see above? The list of vehicles and list of drivers would be populated based on List<Vehicle> and List<Driver>, respectively.

I want functionality like the <h:DataTable> in JSF.

Also, I know about the TableLayout. However, that doesn't help me since I can't attach an array adapter to it or anything like that.


First of all, there's the ListView element, which is what a ListActivity uses.

If you want to have several of those, you could put both of them into a LinearLayout and give each one a weight of 1 so they share the screen. They will have scrolling functionality built in, and scroll independently.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜