I have a simple list application in Android 4.1 and when it’s inheriting of Activity, works perfectly… but when this same application inherit of ListActivity, it fails.
Could anyone tell me why?
I have a simple list application in Android 4.1 and when it’s inheriting of
Share
You might have a listview in your layout xml file.Change it as below.
and check whether its working or not
check out the sample here. You may find this useful.
This is a sample where list view is obtained from extending the ListActivity.
also have a glance at this here
ListActivity has a default layout that consists of a single, full-screen list in the center of the screen. However, if you desire, you can customize the screen layout by setting your own view layout with
setContentView()inonCreate(). To do this, your own view MUST contain a ListView object with the id"@android:id/list"