您的位置:首页 > 产品设计 > UI/UE

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

2016-09-16 18:15 375 查看
错误提示:

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 makeText 错误
相关文章推荐