首页 > 移动平台 > 详细

Android 开发笔记 “The constructor AlertDialog.Builder(new View.OnKeyListener(){}) is undefined”

时间:2015-02-14 12:10:52      阅读:344      评论:0      收藏:0      [点我收藏+]

1、The constructor AlertDialog.Builder(new View.OnKeyListener(){}) is undefined等,应该有很多类似问题

比如你的源码文件名是 Activity.java,就改成
Dialog dialog=new AlertDialog.Builder(Activity.this);
因名称而异。在listener中的this指代的并不是Activity里的this,而两个this成员和方法是完全不一样的,所以会出错,需要告诉IDE即将访问的是Activity的this,这样就不会出问题了。

Android 开发笔记 “The constructor AlertDialog.Builder(new View.OnKeyListener(){}) is undefined”

原文:http://www.cnblogs.com/Dylanblogs/p/4291386.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!