https://kotlinlang.org logo
#android
Title
# android
k

kevinmost

07/24/2017, 3:39 PM
Bundles only support
ArrayList
. I made a set of extensions for this:
Copy code
fun Bundle.putParcelableList(key: String, value: List<Parcelable>) = putParcelableArrayList(key, value.asArrayList())

fun Bundle.putStringList(key: String, value: List<String>) = putStringArrayList(key, value.asArrayList())

internal fun <T> List<T>.asArrayList() = (this as? ArrayList) ?: ArrayList(this)
o

ossama

07/24/2017, 3:46 PM
@kevinmost Many thanks
👍 1