public List imageArray = new ArrayList<>();
private String root = Environment.getExternalStorageDirectory() +"/WhatsApp/Media/.Statuses";
File file = new File(root);
imageArray=getListFiles(file)
private List getListFiles(File parentDir) {
List inFiles = new ArrayList<>();
try {
Queue files = new LinkedList<>();
files.addAll(Arrays.asList(parentDir.listFiles()));
while (!files.isEmpty()) {
File file = files.remove();
if (file.isDirectory()) {
files.addAll(Arrays.asList(file.listFiles()));
} else if (file.getName().endsWith(".jpg") || file.getName().endsWith(".gif")||
file.getName().endsWith(".mp4")) {
inFiles.add(file);
}
}
} catch (Exception e) {
Log.d("error", e.toString());
}
return inFiles;
}
krishan app world is the best android application and source code provide company
Showing posts with label java. Show all posts
Showing posts with label java. Show all posts
How to download whatsapp status in android source code
Subscribe to:
Comments (Atom)