AssetManager mngr_spinner = getAssets(); try { int img_count = 0; folder_array = mngr_spinner.list(parent_folder_name); labels_array = new String[folder_array.length]; for (int i = 0; i < folder_array.length; i++) { // System.out.println("Folder " + folder_array[i]); if ((folder_array[i].endsWith(".png") || folder_array[i].endsWith(".jpg"))) { img_count++; } } } catch (IOException e1) { e1.printStackTrace(); }Note : The folder will not be read if it has no contents in it.
This blog contains answers to all your questions. if can find your answer please drop a comment. Also if you have any answer to a specific question. Please drop a comment and we will publish it under your name.
Showing posts with label read and write. Show all posts
Showing posts with label read and write. Show all posts
Monday, 27 May 2013
How to read a folder structure in the assets folder in Android?
Subscribe to:
Posts (Atom)