title: How do I use a ListView tool to list my activity classes in Eclipse (Android) within an activity?
body: <p>I am making an app that shows a list of campfire songs, and currently all I can see on my app is a list of all the songs and when clicked on, they open up another activity. The next activity that is opened looks how I want it to, but the list of songs on the first activity (menu) only shows a list with no formatting around it or any images or buttons that I have specified in the XML. - I haven't linked these up in the code as they stop the list from appearing at all.</p>
  
  <p>Here is my Java file for Menu.java:</p>
  
  <pre><code>package com.lmarshall1995.scoutsongs;
  
  import android.app.ListActivity;
  import android.content.Intent;
  import android.os.Bundle;
  import android.view.View;
  import android.widget.ArrayAdapter;
  import android.widget.ListView;
  
  public class Menu extends ListActivity{
  
      String classes[] = {"......"};
  
      String items[] = {"......"};
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setListAdapter(new ArrayAdapter&lt;String&gt;(Menu.this, android.R.layout.simple_list_item_1, items));
      }
  
      @Override
      protected void onListItemClick(ListView l, View v, int position, long id) {
          super.onListItemClick(l, v, position, id);
          String song_activity = classes[position];
          try{
          Class&lt;?&gt; ourClass = Class.forName("com.lmarshall1995.scoutsongs." + song_activity);
          Intent ourIntent = new Intent(Menu.this, ourClass);
          startActivity(ourIntent);
          }catch(ClassNotFoundException e){
              e.printStackTrace();
          }
      }
  
  }
  </code></pre>
  
  <p>And here is my XML file for menu.xml that I would like the list to be put in (@+id/list):</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:paddingBottom="@dimen/activity_vertical_margin"
      android:paddingLeft="@dimen/activity_horizontal_margin"
      android:paddingRight="@dimen/activity_horizontal_margin"
      android:paddingTop="@dimen/activity_vertical_margin"
      tools:context=".MainActivity" xmlns:app="http://schemas.android.com/apk/lib/com.google.ads"&gt;
  
      &lt;TextView
          android:id="@+id/SelectSong"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignLeft="@android:id/list"
          android:layout_alignTop="@+id/ic_launcher"
          android:text="@string/SelectSong"
          android:textSize="20sp" /&gt;
  
      &lt;ListView
          android:id="@android:id/list"
          android:layout_width="wrap_content"
          android:layout_height="320dp"
          android:layout_below="@+id/ic_launcher"
          tools:listitem="@android:layout/simple_list_item_1" &gt;
  
      &lt;/ListView&gt;
  
      &lt;ImageView
          android:id="@+id/ic_launcher"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentRight="true"
          android:layout_alignParentTop="true"
          android:contentDescription="@string/ic_launcher"
          android:src="@drawable/ic_launcher" /&gt;
  
      &lt;ImageButton
          android:id="@+id/settings_button"
          android:src="@drawable/settings_button_selected"
          android:contentDescription="@string/action_settings"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentBottom="true"
          android:layout_alignParentLeft="true" /&gt;
  
      &lt;ImageButton
          android:id="@+id/exit_button"
          android:src="@drawable/exit_button_selected"
          android:contentDescription="@string/exit"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentBottom="true"
          android:layout_alignParentRight="true" /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>I was wondering if someone could help me turn what I think is the android.R.layout.simple_list_item_1 into my list (@+id/list) from my menu.xml file. Any suggestions?
  Thanks,
  From
  Laurence =]</p>