Chapter 1 of the 4th Edition - Unresolved Reference: View

I am unable to run GeoQuiz successfully because I continue to receive the “Unresolved Reference: View”.

These are the lines that are being referenced (exactly how they are shown in the book):

trueButton.setOnClickListener { view: View →

falseButton.setOnClickListener { view: View →

I am going to continue researching this issue but if any of you have any idea how to resolve this, I would greatly appreciate it.

Thank you very much…!!

Richard Lombardo

It sounds like you may not have added the import statement for the View.

import android.view.View

The best way to handle it is to put your cursor on one of those errors and Alt-Enter (Window) or Option-Enter (Mac). That should quick fix it.

Thank you so much…!!