title: Get last Modified Date of Files in a directory
body: <p>I am having some trouble displaying the files currently modified date. </p>
  
  <pre><code>public class MyAdapter extends ArrayAdapter&lt;String&gt; {
  
  String dir = "/FileDirectory/";
  
  File file = new File(Environment.getExternalStorageDirectory() + dir);
  
  private final Activity context;
  
  Date lastModified = new Date(file.lastModified()); 
  SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");  
  String formattedDateString = formatter.format(lastModified); 
  
  private String dateFormat = "dd/MM/yyyy HH:mm:ss";
  
  static class ViewHolder {
  
      public TextView text;
  }
  
  public MyAdapter(Activity context, String[] date) {
      super(context, R.layout.row, date);
      this.context = context;
      formatter = new SimpleDateFormat(dateFormat);
  }
  
  @Override
  public View getView(int position, View convertView, ViewGroup parent) {
  
      View rowView = convertView;
      if (rowView == null) {
          LayoutInflater inflater = context.getLayoutInflater();
          rowView = inflater.inflate(R.layout.row, null);
          ViewHolder viewHolder = new ViewHolder();
          viewHolder.text = (TextView) rowView.findViewById(R.id.FilePath);
          rowView.setTag(viewHolder);
      }
  
      ViewHolder holder = (ViewHolder) rowView.getTag();
  
      String s = formattedDateString;
  
      holder.text.setText(s);
  
          return rowView;
      }
  }
  </code></pre>
  
  <p>As of now it just displays the last modified date of the directory on all files.  Any help would be greatly appreciated!</p>