In my app i want to change the Activity contentview
if a button was clicked for example.
In the begining i call the first layou:
public
The problem is that your activity class may have extended ListActivity, and you should have a ListView whose id attribute is android.R.id.list
in your layout xml file, so that your ListActivty class can find the main list of this activity.(if someClass extends ListActivity, it means that someClass, mainly has the role of a list). Just set your ListView id to android.R.id.list
in layout/item_view.xml
.