Get last Modified Date of Files in a directory

前端 未结 4 2055
Happy的楠姐
Happy的楠姐 2021-01-17 13:38

I am having some trouble displaying the files currently modified date.

public class MyAdapter extends ArrayAdapter {

String dir = \"/FileDire         


        
4条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-17 13:59

    File file = new File(Environment.getExternalStorageDirectory() + dir);

    Points to directory, not a file.

    If you need modified date of each file separately in a directory, just use walkfiletree.

    Check this.

提交回复
热议问题