ListActivity vs ListView

I am learning Android programming, and here are my doubts: I can create a full ListView with the ListView itself or through ListActivity.

Is there one that is preferable to the other, whether for reasons of efficiency, usability of the code, or best Android practices?

+4
source share
3 answers

If it's fullscreen, it's probably ListActivity.

It is not always clear how to divide the parts of the application into "Actions", but one action on the screen is quite common. 1 You should probably not show a full-screen ListView across other views in the same activity.

, ListActivity - . , . , , , (, BaseActivity, ), ListView . ( ListActivity, , , ListView.)

1. , , .

+7

, .

.

listview , ListActivity .

. , listview , .

+1

in my opinion, it is better to make listView in xml.

in my application, I have listView and tixtview in framelayout, loading list data from the database, if the database is empty, I hide listview and show textView (telling the user that there is no data to display), and if there is data in the database, I showing listview and hiding textview

0
source

All Articles