android编译错误“OnClickListener cannot be resolved to a type”解决方案
来源:互联网 发布:ubuntu tm 编辑:程序博客网 时间:2024/06/06 14:00
在android代码编译时可能会出现如下错误:
部分代码:
- <span style="font-size:18px;">public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.addnew);
- btn_img=(ImageButton) this.findViewById(R.id.btn_img);
- btn_img.setOnClickListener(new OnClickListener() {
- public void onClick(View v) {
- initImageChooseDialog();
- imageChooseDialog.show();
- }
- });</span>
错误提示:OnClickListener cannot be resolved to a type
解决方案:将语句btn_img.setOnClickListener(new OnClickListener(){···}中的OnClickListener改为View.OnClickListener即可
0 0
- android编译错误“OnClickListener cannot be resolved to a type”解决方案
- android编译错误“OnClickListener cannot be resolved to a type”解决方案
- android编译错误“OnClickListener cannot be resolved to a type”解决方案
- android编译错误“OnClickListener cannot be resolved to a type”解
- onclicklistener cannot be resolved to a type
- Android:OnClickListener cannot be resolved to a type
- android: OnClickListener cannot be resolved to a type
- 【android】:OnClickListener cannot be resolved to a type
- 关于“OnClickListener cannot be resolved to a type”问题
- ERROR:OnClickListener cannot be resolved to a type
- 【转】OnClickListener cannot be resolved to a type
- Error:OnClickListener cannot be resolved to a type
- OnClickListener cannot be resolved to a type解决方法
- cannot be resolved to a type解决方案
- cannot be resolved to a type错误
- cannot be resolved to a type的解决方案
- Cocos2dxActivity cannot be resolved to a type解决方案
- Cocos2dxActivity cannot be resolved to a type解决方案
- Flex Logging
- OpenStack及其构成简介(转)
- 分支-15. 日K蜡烛图(15)
- python爬虫Pragmatic系列I
- 关于在 Android EditText 控件 中过滤空格或其他字符
- android编译错误“OnClickListener cannot be resolved to a type”解决方案
- ANDROID TEXTVIEW 设置字体颜色
- linux基础教程(6)软件安装和开源业管理
- 第3周项目1三角形类1
- 【Android UI设计】之自定义计时器
- Flex 使用ArrayCollection的FilterFunction进行数据过滤
- jsp扫描仪编程示例程序源代码下载
- Flex DataGrid 可编辑 控制输入值的长度——maxchars
- 在遍历中使用 iterator/reverse_iterator 进行 Erase 的用法