Apologies if this question isn't Kotlin enough but...
# android
v
Apologies if this question isn't Kotlin enough but I have a question about this bit of code. 1. Will
externalStorageVolumes
only return two elements max? Will the first element always be phone storage that isn't removable? 2. Is that
map
efficient? I think it looks a little verbose and I'm not sure how to tighten it up
z
For 2, do you actually need to convert to an Array? It’s idiomatic in Kotlin to just work with Lists directly, moreso than Arrays, unless you have a really specific use case.
v
@Zach Klippenstein (he/him) [MOD] I have it being fed into an AlertDialog list for a Storage Fragment. I think this is how I should do it but any tips are most welcome!
👍 1
^ added a bit more for context.