The method setOnClickListener(View.OnClickListener) in the type View is not applicable for the arguments (new OnClickListener(){}) 差一个包没有添加 import android.view.View. OnClickListener;