I have an array of nulls that I initialize with Strings. Then I have to pass it to a function that requires Array<String> instead of Array<String?>. So how can I go around this issue?
val list_names = arrayOfNulls<String>(plant_list.size)
for(item in plant_list){ list_names.plus(item.name) }
val myListAdapter = MyListAdapter(activity!!,list_names,list_types,list_images) // list_names must be Array<String>
I also want to mention that changing it in the Adapter would only complicate things, so I would like to do it all from here.