ListView without ListActivity

后端 未结 2 1855
傲寒
傲寒 2020-12-01 15:17

I\'m trying to set a Listview under some other Widgets (Buttons, editText, etc). I don\'t want to use another activity for the listview. After reading some I found How can I

2条回答
  •  佛祖请我去吃肉
    2020-12-01 15:33

    You can use your own layout with a ListActivity. Make your activity extend ListActivity, create your own layout and make sure that the ListView has android:id="@android:id/list" (this is how the ListActivity links to the ListView in your own layout), then in onCreate set your layout with setContentView.

提交回复
热议问题