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

Converting File[] to ArrayList

$
0
0

Hi, I've tested in several ways this conversion and the most logical way, seems to me would be by iterating, but it gives the error:

The method add(String) in the type ArrayList is not applicable for the arguments (File)

How to do this, thanks.

ArrayList<String> alfiles = new ArrayList<String>();
File[] files = f.listFiles();
for (File each : files) alfiles.add(each);

Viewing all articles
Browse latest Browse all 941

Trending Articles