title: Music Player library ListView populating issue
body: <p>I have a music player app that should open and show a list of tracks on your phone/sdcard but when I launch the application it shows me nothing..</p>
  
  <p>I followed a tutorial so im not completely clear on what everything is supposed to do. Especially with the xml ListView: <a href="http://www.androidhive.info/2012/03/android-building-audio-player-tutorial/" rel="nofollow noreferrer">http://www.androidhive.info/2012/03/android-building-audio-player-tutorial/</a></p>
  
  <p>Here are my java classes that should be significant to what might be causing this:</p>
  
  <p>Library.java</p>
  
  <pre><code>public class Library extends ListActivity {
  // Songs list
  public ArrayList&lt;HashMap&lt;String, String&gt;&gt; songsList = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.library);
  
      ArrayList&lt;HashMap&lt;String, String&gt;&gt; songsListData = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();
  
      TrackManager plm = new TrackManager();
      // get all songs from sdcard
      this.songsList = plm.getPlayList();
  
      // looping through playlist
      for (int i = 0; i &lt; songsList.size(); i++) {
          // creating new HashMap
          HashMap&lt;String, String&gt; song = songsList.get(i);
  
          // adding HashList to ArrayList
          songsListData.add(song);
      }
  
      // Adding menuItems to ListView
      ListAdapter adapter = new SimpleAdapter(this, songsListData, R.layout.libraryitem, new String[] { "songTitle" }, new int[] { R.id.songTitle });
  
      setListAdapter(adapter);
  
      // selecting single ListView item
      ListView lv = getListView();
      // listening to single listitem click
      lv.setOnItemClickListener(new OnItemClickListener() {
  
          @Override
          public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {
              // getting listitem index
              int songIndex = position;
  
              // Starting new intent
              Intent in = new Intent(getApplicationContext(), Player.class);
              // Sending songIndex to PlayerActivity
              in.putExtra("songIndex", songIndex);
              setResult(100, in);
              // Closing PlayListView
              finish();
          }
      });
  }
  </code></pre>
  
  <p>TrackManager.java</p>
  
  <pre><code>public class TrackManager {
  // SDCard Path
  final String MEDIA_PATH = new String(Environment.getExternalStorageDirectory().getPath());
  private ArrayList&lt;HashMap&lt;String, String&gt;&gt; songsList = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();
  
  // Constructor
  public TrackManager() {
  
  }
  
  // Function to read all mp3 files from sdcard and store the details in
  // ArrayList
  
  public ArrayList&lt;HashMap&lt;String, String&gt;&gt; getPlayList() {
      File home = new File(MEDIA_PATH);
      if (home.listFiles(new FileExtensionFilter()).length &gt; 0) {
          for (File file : home.listFiles(new FileExtensionFilter())) {
              HashMap&lt;String, String&gt; song = new HashMap&lt;String, String&gt;();
              song.put("songTitle", file.getName().substring(0, (file.getName().length() - 4)));
              song.put("songPath", file.getPath());
  
              // Adding each song to SongList
              songsList.add(song);
          }
      }
      // return songs list array
      return songsList;
  }
  
  // Class to filter files which are having .mp3 extension
  
  class FileExtensionFilter implements FilenameFilter {
      public boolean accept(File dir, String name) {
          return (name.endsWith(".mp3") || name.endsWith(".MP3"));
      }
  }
  }
  </code></pre>
  
  <p>I have some xml layouts that show a listview which these classes should populate but i just get a blank empty list like there is nothing there:</p>
  
  <p><img src="https://i.stack.imgur.com/zvgb4.png" alt="Library activity"></p>
  
  <p>UPDATE</p>
  
  <p>library.xml</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:background="#111111"
  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=".Library" &gt;
  
  
  &lt;TextView
      android:id="@+id/tvTracks"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:text="@string/tracks"
      android:textSize="20sp" /&gt;
  
  &lt;ListView
      android:id="@android:id/list"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:layout_below="@+id/tvTracks"
      android:divider="#999999"
      android:dividerHeight="1dp"
      android:listSelector="@drawable/list_selector" /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>libraryitem.xml for ListView</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:background="@drawable/list_selector"
  android:orientation="vertical"
  android:padding="5dp"
  tools:ignore="SelectableText" &gt;
  
  &lt;TextView
      android:id="@+id/songTitle"
      android:text="@string/title"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:padding="5dp"
      android:textSize="15sp" /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>Hope someone can figure out my problem..</p>