0
我有我實現的ExpandaleList和BaseExpandableListAdapter。通過編程更改ExpandableList視圖
現在有時我需要出示其他的XML內容,所以我試圖做的事:
ExpandableList.this.setContentView(R.layout.errorscreen);
但後來我得到這個異常:
ERROR/AndroidRuntime(23948):JAVA。 lang.RuntimeException,你的內容必須有一個ExpandableListView,它的id屬性是'android.R.id.list'。
現在,我已經被告知這樣做是爲了解決它:
add ExpandableListView to your xml layout and set it's id to list. Like so:
<ExpandableListView android:id="@id/android:list" android:layout_width="fill_parent"android:layout_height="fill_parent"/>
如何做到這一點編程?