scan sd card

// scan sd card
	public void scanMusic(File file) {
		File[] listFiles = file.listFiles(new FileFilter() {

			@Override
			public boolean accept(File pathname) {
				if (pathname.isDirectory()) {
					return true;
				} else {
					// Determine whether the path of the next file contains. mp3
					if (pathname.getPath().endsWith(".mp3")) {
						return true;
					}
				}
				return false;
			}
		});
		for(int i=0;i<listFiles.length;i++){
			if(listFiles[i].isDirectory()){
				
			}else{
				fileList()
			}
		}
	}

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326433860&siteId=291194637