开发者

Embedding a ListView in an Activity in Android

开发者 https://www.devze.com 2023-03-31 02:59 出处:网络
I have a listview a开发者_如何学运维t the top of my activity, does the entire activity need to extend ListActivity? Or can the main activity simply extend just Activity and a private sub-class can ext

I have a listview a开发者_如何学运维t the top of my activity, does the entire activity need to extend ListActivity? Or can the main activity simply extend just Activity and a private sub-class can extend ListActivity to create the listview? I can't comprehend the best way to do this so a shove in the right direction would be awesome!


You can have Views in a ListActivity that are not ListViews. If you only want one ListView then ListActivity will save you a lot of typing. But you don't have to use it. You can use a normal Activity and do all the ListView setup yourself. Are you worried about something specific?

The part about having more than one Activity for the same UI doesn't really make any sense.

0

精彩评论

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