I want to get a StringArray from Resources and convert it into a MutableList
I tried the following code
var morality = mutableListOf(activity.resources.getStringArray(R.string.morality))
but it gives me an error saying
Type mismatch
Required: String?
Found: ArrayOut<(out)String!>!
I solved it with
var morality = (activity.resources.getStringArray(R.string.morality).toMutableList())
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With