N
N3cron
Fortgeschrittenes Mitglied
- 1
Hallo. Frage, wie kann ich zb 5 Verzeichnisse abfragen und diese files darin mir auflisten lassen. Mein bisheriger Code sieht wie folgt aus, leider nur mit 1 Verzeichnis
if (android.os.Environment.getExternalStorageState().equals(android.os.Environment.MEDIA_MOUNTED)) {
final File file = new File(Environment.getExternalStorageDirectory() + "/Download/test/test1");
hier brauche ich aber noch /test2, /test3. Kann man das irgenwie anhängen?
Beispiel was nicht funktioniert
final File file = new File(Environment.getExternalStorageDirectory() + "/Download/test/test1 + /Download/test/test2");
if (file.isDirectory()) {
final File list[] = file.listFiles();
for (int i = 0; i < list.length; i++) {
final List<String> fullfilename = (Arrays.asList(list.getName().split("!")));
final List<String> myListss = (Arrays.asList(list.getName().split("\\.jpg")));
name = fullfilename.get(0);
first = myListss.get(0);
Danke für Hilfe
if (android.os.Environment.getExternalStorageState().equals(android.os.Environment.MEDIA_MOUNTED)) {
final File file = new File(Environment.getExternalStorageDirectory() + "/Download/test/test1");
hier brauche ich aber noch /test2, /test3. Kann man das irgenwie anhängen?
Beispiel was nicht funktioniert
final File file = new File(Environment.getExternalStorageDirectory() + "/Download/test/test1 + /Download/test/test2");
if (file.isDirectory()) {
final File list[] = file.listFiles();
for (int i = 0; i < list.length; i++) {
final List<String> fullfilename = (Arrays.asList(list.getName().split("!")));
final List<String> myListss = (Arrays.asList(list.getName().split("\\.jpg")));
name = fullfilename.get(0);
first = myListss.get(0);
Danke für Hilfe