Skip to content

Instantly share code, notes, and snippets.

@ritshpatidar
Last active October 6, 2019 05:33
Show Gist options
  • Save ritshpatidar/eabe45be289a5c646066029a362e6cc9 to your computer and use it in GitHub Desktop.
Save ritshpatidar/eabe45be289a5c646066029a362e6cc9 to your computer and use it in GitHub Desktop.
//A code for article published at calloftechies.com
private fun getNames() : ArrayList<String?>{
var files = myDirectory.listFiles()
val fileNames : ArrayList<String?> = ArrayList()
for(file in files){
fileNames.add(file.getName())
}
return fileNames
}
/*
It will not get called directly, you have to call it.
I have explained MethodChannel in my last article I was talking about, you can get
the code from there. You also have to give permissions to read
external storage in AndroidManiFest.xml.
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment