无法解析方法 'makeText(anonymous android.view.View.OnclickListener, java.lang.String, int)'

Cannot resolve method 'makeText(anonymous android.view.View.OnclickListener, java.lang.String, int)'

我在 ImageButton 中创建 Toast 时出错

Cannot resolve method 'makeText(anonymous android.view.View.OnclickListener, java.lang.String, int)'

只是改变

Toast.makeText(this, "text", Toast.LENGTH_SHORT).show();

Toast.makeText(ActivityName.this, "text", Toast.LENGTH_SHORT).show();