title: How to control what setAdapter shows?
body: <p>I am trying to create a Music Player (learning). I retrieved the songs from SD card which include song's name and its path, which is stored in ArrayList&lt; HashMap&lt; String, String>>.</p>
  
  <p>MainActivity.java</p>
  
  <pre><code>public class MainActivity extends AppCompatActivity {
  
      ListView listView;
  
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          listView = (ListView)findViewById(R.id.listView);      
  
          ArrayList&lt;HashMap&lt;String, String&gt;&gt; song = new SongsManager().getPlayList();
  
          ArrayAdapter&lt;HashMap&lt;String, String&gt;&gt; songAdapter = new ArrayAdapter&lt;&gt;(getApplicationContext(), android.R.layout.simple_list_item_1, song);
  
          listView.setAdapter(songAdapter);
  
          listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
              @Override
              public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {
  
                  int itemPos = position;
                  //String itemVal = (String)listView.getItemAtPosition(position);
  
                  HashMap&lt;String, String&gt; m = (HashMap&lt;String, String&gt;) listView.getItemAtPosition(position);
  
                  String strArr[] = new String[m.size()];
                  int i = 0;
  
                      for (String current : m.values()) {
                          strArr[i] = current;
                          i++;
                      }
  
  
                  Toast.makeText(getApplicationContext(), itemPos+" - "+strArr[1], Toast.LENGTH_SHORT).show();
              }
          });
  
      }
  
  }
  </code></pre>
  
  <p>SongsManager.java file</p>
  
  <pre><code>package com.example.app.musicplayer;
  
  import android.os.Environment;
  
  import java.io.File;
  import java.util.ArrayList;
  import java.util.HashMap;
  
  public class SongsManager {
  
      final String MEDIA_PATH = Environment.getExternalStorageDirectory()
              .getPath() + "/";
      private ArrayList&lt;HashMap&lt;String, String&gt;&gt; songsList = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();
      private String mp3Pattern = ".mp3";
  
      // Constructor
      public SongsManager() {
  
      }
  
      /**
       * Function to read all mp3 files and store the details in
       * ArrayList
       * */
      public ArrayList&lt;HashMap&lt;String, String&gt;&gt; getPlayList() {
          System.out.println(MEDIA_PATH);
          if (MEDIA_PATH != null) {
              File home = new File(MEDIA_PATH);
              File[] listFiles = home.listFiles();
              if (listFiles != null &amp;&amp; listFiles.length &gt; 0) {
                  for (File file : listFiles) {
                      System.out.println(file.getAbsolutePath());
                      if (file.isDirectory()) {
                          scanDirectory(file);
                      } else {
                          addSongToList(file);
                      }
                  }
              }
          }
          // return songs list array
          return songsList;
      }
  
      private void scanDirectory(File directory) {
          if (directory != null) {
              File[] listFiles = directory.listFiles();
              if (listFiles != null &amp;&amp; listFiles.length &gt; 0) {
                  for (File file : listFiles) {
                      if (file.isDirectory()) {
                          scanDirectory(file);
                      } else {
                          addSongToList(file);
                      }
  
                  }
              }
          }
      }
  
      private void addSongToList(File song) {
          if (song.getName().endsWith(mp3Pattern)) {
              HashMap&lt;String, String&gt; songMap = new HashMap&lt;String, String&gt;();
              songMap.put("songTitle",
                      song.getName().substring(0, (song.getName().length() - 4)));
              songMap.put("songPath", song.getPath());
  
              // Adding each song to SongList
              songsList.add(songMap);
          }
      }
  }
  </code></pre>
  
  <p>But when I run the application i get both song's name as well as its path displayed on the listView.</p>
  
  <p>Is there a way by which I can only display its name and not its path.</p>