title: Last modified date of external file in android
body: <p>I am developing an application in which there is one external file stored on SD card. This file is replaced from time to time. I want to know how I can detect whether the file has been replaced or not.</p>
  
  <p>I tried following</p>
  
  <pre><code>    File file = new File("filepath");
      Date lastModDate = new Date(file.lastModified());
      Log.w("File last modified @ : ", lastModDate.toString());
  </code></pre>
  
  <p>The lastmodified method always returns the date "1970-01-01", even though the file is replaced from time to time.</p>
  
  <p>Can anyone suggest a sample code which detects the external file modified.</p>