An activity that displays a list of items by binding to a data source such as an array or Cursor, and exposes event handlers when the user selects an item.
The class will inherit from the ListActivity class. The ListActivity requires that an adapter fill the contents of the list view.
5. Compile and run!
Next Recommended Article: How to Display TextView instead of Listview when Empty
Resources:
http://developer.android.com/reference/android/app/ListActivity.html
http://xahlee.info/java-a-day/extend.html
The class will inherit from the ListActivity class. The ListActivity requires that an adapter fill the contents of the list view.
2. The ListView Name must be set to android:list
3. In the MainActivity.java file, add the below import.
4. Extend the class named ListActivity in your MainActivity class.
3. In the MainActivity.java file, add the below import.
import android.app.ListActivity;
5. Compile and run!
Next Recommended Article: How to Display TextView instead of Listview when Empty
Resources:
http://developer.android.com/reference/android/app/ListActivity.html
http://xahlee.info/java-a-day/extend.html