saving . . . saved Compiling Error has been deleted. Compiling Error has been hidden .
Compiling Error
Title
Question
Please this line of code is giving me compiling error "languageOptions.addAll(ArrayList(fossVsLanguage.get(selectedFoss)))".

This is the compiler error below:
<span style="background-color: rgb(250, 250, 250);">Type inference failed. Please try to specify type arguments explicitly. Type mismatch: inferred type is kotlin.collections.ArrayList<string>? /* = java.util.ArrayList<string>? */ but (MutableCollection<out string!="">..Collection<string!>) was expected</string!></out></string></string> </span>
<span style="background-color: rgb(250, 250, 250);">
</span>
<span style="background-color: rgb(250, 250, 250);">Please I restart it but the problem persist.</span>
<span style="background-color: rgb(250, 250, 250);">I also read the blog you send but the problem keep on coming.</span>
<span style="background-color: rgb(250, 250, 250);">Thank you.</span>

Android-app-using-Kotlin Creating-a-Search-App 08-09 min 20-30 sec 01-10-20, 6:53 p.m. edemtech

Answers:

Use the code in the code files link which is available below the video player.




05-10-20, 4:15 p.m. NirmalaVenkat


Please I have used the code in the code file below the video but the problem still persist. 
06-10-20, 12:56 p.m. edemtech


Hi Friends
 use below code (since languageOptions is mutable list we have to convert the arraylist we get, that is, fossVsLanguage to mutable list): 
languageOptions.addAll(fossVsLanguage.get(selectedFoss) as MutableList<String>) instead of languageOptions.addAll(ArrayList(fossVsLanguage.get(selectedFoss)))


10-05-21, 1:06 a.m. iliyas2008


Log-in to answer to this question.