When passing in this as a parameter into a class, says context required found empty
For my code I am passing in this for the context. This is in mainActivity.kt file
This is the error I am getting
https://i.stack.imgur.com/6haYf.png▾
In my constructor I am calling it like this
class ForecastAdapter(val forecast: Forecast, val context: Context) : RecyclerView.Adapter(){
and then I am passing it in the class like this:
runOnUiThread {
view.adapter = ForecastAdapter(weather, this)
}
So I have no idea why this isn't working for...