开发者

ListView and ListActivity

I have a program for Android do I need to modify my activity to be a ListActivity to use a ListView or can开发者_Go百科 I just leave it as a regular activity?

Thanks in advance.


You should extend your activity to make it a ListActivity.

Among the reasons is the fact that you get the onListItemClick() method which is called whenever you click a item which saves you from creating a listener.

Besides, you don't lose anything, if you want to change the layout of a ListActivity you still can with setContentView() method from Activity.


The answer to your question is NO.

You do not NEED to use ListActivity.

You can easily add a ListView to a regular Activity.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜