I am using a class which extends Activity to obtain a list from an API…
In some apps which do basically the same, the devs extended ListActivity…
Which are the differences?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
ListActivityextends the functionality of the commonandroid.app.Activityby providing a number of list centric features ‘for-free’ if you like. For example, the handling of a list entry click is neatly contained within ListActivity’sonListItemClick(...)whereas if you were using a plainandroid.app.Activitythen you would need to implement this manually with anOnClickListenerand implementation.By all accounts, if your layout contains a list then use a ListActivity/ListFragment since it is a useful extension. It does not mean your whole screen layout has to be list but a portion of it has to host a ListView widget with identifier,
id="@android:id/list".The Javadoc on the class with useful examples of how to use it can be found here.