title: how to use android ExpandableListView in xml?
body: <p>i'm trying to show an expandableListView with a button before it in xml. but somehow, i could not get it work in the code.</p>
  
  <p>my xml (i uses RelativeLayout as parent layout) :</p>
  
  <pre><code>&lt;FrameLayout
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:layout_below="@id/mlt_file_titleFrame"
      android:background="#FF3300"
      android:padding="5dp"
      android:id="@+id/mlt_file_frameL"
      &gt;
  
      &lt;Button
          android:id="@+id/mlt_file_btn_edit"
          android:text="Edit"
          android:layout_height="wrap_content"
          android:layout_width="wrap_content"
          android:layout_gravity="left"
          /&gt;
  
  &lt;/FrameLayout&gt;
  
  &lt;ExpandableListView 
      android:id="@android:id/list"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:layout_below="@id/mlt_file_frameL"
      &gt;
  
  &lt;/ExpandableListView&gt;
  </code></pre>
  
  <p></p>
  
  <p>my code :</p>
  
  <pre><code>public class MLT_File extends ExpandableListActivity {
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.mlt_file_intent);
      // Set up our adapter
      ExpandableListAdapter listAdapter = new customListAdapter();
  
      ExpandableListView expLV = (ExpandableListView) findViewById(R.id.mlt_expList);//getExpandableListView();
      expLV.setAdapter(listAdapter);
  
      //registerForContextMenu(expLV);
  
  }//onCreate
  
  /**
   * A simple adapter which maintains an ArrayList of photo resource Ids. 
   * Each photo is displayed as an image. This adapter supports clearing the
   * list of photos and adding a new photo.
   *
   */
  public class customListAdapter extends BaseExpandableListAdapter {
      // Sample data set.  children[i] contains the children (String[]) for groups[i].
      private File mapFolder = new File (Environment.getExternalStorageDirectory(),"/MLT/Map");
      private File recordFolder = new File (Environment.getExternalStorageDirectory(),"/MLT/Record");
      private File scribbleFolder = new File (Environment.getExternalStorageDirectory(),"/MLT/Scribble");
      private String[] groups = { "Map", "Record", "Scribble" };
      private String[][] children = { mapFolder.list(), recordFolder.list(), scribbleFolder.list() };
  
      public Object getChild(int groupPosition, int childPosition) {
          return children[groupPosition][childPosition];
      }
  
      public long getChildId(int groupPosition, int childPosition) {
          return childPosition;
      }
  
      public int getChildrenCount(int groupPosition) {
          return children[groupPosition].length;
      }
  
      public View getChildView(int groupPosition, int childPosition, boolean isLastChild,
                                  View convertView, ViewGroup parent) {
  
          TextView textView = new TextView(MLT_File.this);
          textView.setBackgroundColor(Color.BLACK);
          textView.setGravity(Gravity.CENTER_VERTICAL | Gravity.LEFT);
          textView.setPadding(100, 0, 0, 0);
          textView.setTextColor(Color.WHITE);
          textView.setTextSize(20);
          textView.setText(getChild(groupPosition, childPosition).toString());
          return textView;
      }//getChildView
  
      public Object getGroup(int groupPosition) {
          return groups[groupPosition];
      }
  
      public int getGroupCount() {
          return groups.length;
      }
  
      public long getGroupId(int groupPosition) {
          return groupPosition;
      }
  
      public View getGroupView(int groupPosition, boolean isExpanded, View convertView,
              ViewGroup parent) {
          TextView textView = new TextView(MLT_File.this);
          textView.setBackgroundColor(Color.WHITE);
          textView.setGravity(Gravity.CENTER_VERTICAL | Gravity.LEFT);
          textView.setPadding(100, 0, 0, 0);
          textView.setTextColor(Color.BLACK);
          textView.setTextSize(25);
          textView.setText(getGroup(groupPosition).toString());
  
          /*Button btn = new Button(MLT_File.this);
          btn.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));
          btn.setText("Edit");
          btn.setId(100+groupPosition);
          btn.setGravity(Gravity.CENTER_VERTICAL | Gravity.RIGHT);
  
          TableLayout layout = new TableLayout(MLT_File.this);
          layout.setBackgroundColor(Color.WHITE);
          layout.setColumnStretchable(1, true);
          layout.addView(textView);
          //layout.addView(btn);*/
  
          return textView;
      }
  
      public boolean isChildSelectable(int groupPosition, int childPosition) {
          return true;
      }
  
      public boolean hasStableIds() {
          return true;
      }
  
  }//customListAdapter
  }//class
  </code></pre>
  
  <p>my logcat :</p>
  
  <pre><code>java.lang.RuntimeException: Your content must have a ExpandableListView whose id attribute is 'android.R.id.list'
  </code></pre>
  
  <p>i tried to change the id to id="android:id/list", but i dont know how to create the ExpandableListView object with that id, as it gives an error saying its empty.</p>
  
  <p>*impt : i wanted to create an ExpandableListView object is so that i can cast the onChildClickListener.</p>