There is a list of files that are created by the current date and time. I do not need to display all files, but only for the last 3 days. How can this be done?
listViewArchive = findViewById(R.id.listViewArchive);
File[] filelist = dir.listFiles();
String[] theNamesOfFiles = new String[filelist.length];
for (int i = 0; i < theNamesOfFiles.length; i++) {
theNamesOfFiles[i] = filelist[i].getName();
}
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, theNamesOfFiles);
listViewArchive.setAdapter(adapter);
I am in this newbie, you can have a detailed answer.
