android错误:The method makeText(Context, CharSequence, int) in the type

错误提示:The method makeText(Context, CharSequence, int) in the type Toast is not applicable for the arguments (new View.OnClickListener(){}, String, int)

错误原由:在makeText的第一个参数Context指的是上下文对象,而此处上下文并不是该Activity。。。你必须使用 自己的Activity.this如我的是Toast.makeText(MainActivity.this, "已经到了第一周", Toast.LENGTH_SHORT).show() ;

你可能感兴趣的:(android,String)