Sudhir Singh Khanger
06/16/2018, 5:02 AMfun setMovieData(movies: MutableList<Movie?>) {
movieList = movies
notifyDataSetChanged()
}
I am trying to access this function from outside the Android's Adapter class in an Activity class but I can't access it. I am not sure how this works in Kotlin. I tried making it a companion object but then both movieList
and notifyDataSetChanged()
are inaccessible in companion object.
I am trying to do something like https://github.com/udacity/ud851-Sunshine/blob/6ca736c2395e1893e9dc82373141a38342e78238/S03.02-Solution-RecyclerViewClickHandling/app/src/main/java/com/example/android/sunshine/ForecastAdapter.java#L146