Change Activity layout

前端 未结 1 1792
不思量自难忘°
不思量自难忘° 2021-01-26 02:12

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          


        
1条回答
  •  后悔当初
    2021-01-26 02:50

    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.

    0 讨论(0)
提交回复
热议问题