Why do I keep getting "Unresolved reference:layout" message in this part of my code (i have been creating a custom adapter for a RecyclerView item, the item itself is contained within the game.xml file):
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): GameViewHolder {
val view = LayoutInflater.from(parent.context).inflate(R.layout.game, parent, false)
return GameViewHolder(view)
}
To be more specific, the "layout" in R.layout.game is red in color(not underlined) and when i hover over it i get a previously mentioned message.
Same happens for "id" keyword in this part:
inner class GameViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
val gameWinner: TextView = itemView.findViewById(Build.VERSION_CODES.R.id.winner_textview)
val highscore: TextView = itemView.findViewById(Build.VERSION_CODES.R.id.highscore)
}
I have been stuck on this for a while, any help is welcomed. Thanks in advance!
I though this had something to do with Gradle, since i had issues with it before, but even after it synced successfully, the same issue persists.