Quantcast
Channel: Android Mode - Processing 2.x and 3.x Forum
Viewing all articles
Browse latest Browse all 941

File list files in directory

$
0
0

Hi. I've tried several code snippets to get the file names of a specific directory, but all gave me a null. What would be the correct way? Thanks in advance.

import java.io.File;
import android.os.Environment;

// String path = Environment.getExternalStorageDirectory().toString()+"/Download";
 String path = "/storage/emulated/legacy/Download"; 

 File f = new File(path); 
 File[] files = f.listFiles();
 printArray(files);

Viewing all articles
Browse latest Browse all 941

Trending Articles