title: How to remove absolute path in android
body: <p>I have a list-view in which i am loading a audio file from server and by clicking on any item it play's that audio. Now i have a problem is that i am getting full path that is absolute path and i just want the name of that file only.</p>
  
  <p><img src="https://i.stack.imgur.com/00voN.png" alt="enter image description here"></p>
  
  <p>So basically in above image you can see that it is printing full path with //..../.mp3 and i just want to show file name only. So how can i do this. </p>
  
  <p>I have tried many solution like <strong>.getName()</strong> method with file and string object but it is not working properly.</p>
  
  <p>Below is my code.</p>
  
  <pre><code>@Override
          protected String doInBackground(String... arg0) {
              try {
                  urlAudio = new URL("http://server/folder/uploadAudio");
              } catch (MalformedURLException e) {
                  e.printStackTrace();
              }
              ApacheURLLister lister1 = new ApacheURLLister();
              List&lt;String&gt; tempList = new ArrayList&lt;String&gt;();
  
              try {
                  tempList = lister1.listAll(urlAudio);
              } catch (IOException e) {
                  e.printStackTrace();
              }
  
              for (int i = 0; i &lt; tempList.size(); i++) {
                  myList.add(tempList.get(i).split("/")[tempList.get(i)
                          .split("/").length - 1]);
              }
              return null;
          }
  </code></pre>
  
  <p>Any help would be greatly appreciated.  Thank you in advance.</p>