Ich habe eine ExpandaleList und BaseExpandableListAdapter, die ich implementiert.Ändern Sie die Ansicht ExpandableList programmgesteuert
Jetzt manchmal brauche ich andere XML-Inhalte zu zeigen, also ich versuche zu tun:
ExpandableList.this.setContentView(R.layout.errorscreen);
aber dann bekomme ich diese Ausnahme:
ERROR/Android Runtime (23948): java. lang.RuntimeException, Ihr Inhalt muss eine ExpandableListView haben, deren ID-Attribut "android.R.id.list" lautet.
Jetzt habe ich gesagt, dies zu tun, um es zu beheben:
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"/>
Wie es programmatisch zu tun?