The method setOnClickListener(View.OnClickListener) in the type View is not
来源:互联网 发布:xampp mac配置环境 编辑:程序博客网 时间:2024/05/02 01:17
刚开始学习 android 在学习编写记事本监听器的时候,总是报错。
遇到的问题
按快捷提示键出现(MAINACTIVITY)的是
@Override public void onClick(DialogInterface arg0, int which) { // TODO Auto-generated method stub
而不是视频中的 @Override public void onClick(View v) { // TODO Auto-generated method stub
不管怎么修改都无法通过。
最后我找到了解决办法,正在这里跟大家分享一下
有两点需要修改
1.把 @Override public void onClick(DialogInterface arg0, int arg1) { // TODO Auto-generated method stub 改成
@Override public void onClick(View v) { // TODO Auto-generated method stub
2. 把 import android.content.DialogInterface.OnClickListener; 改成 import android.view.View.OnClickListener;
遇到的问题
按快捷提示键出现(MAINACTIVITY)的是
@Override public void onClick(DialogInterface arg0, int which) { // TODO Auto-generated method stub
而不是视频中的 @Override public void onClick(View v) { // TODO Auto-generated method stub
不管怎么修改都无法通过。
最后我找到了解决办法,正在这里跟大家分享一下
有两点需要修改
1.把 @Override public void onClick(DialogInterface arg0, int arg1) { // TODO Auto-generated method stub 改成
@Override public void onClick(View v) { // TODO Auto-generated method stub
2. 把 import android.content.DialogInterface.OnClickListener; 改成 import android.view.View.OnClickListener;
(就是导入的文件)
总的来说就是导包出现了问题,自动导入的包跟文件所需要的包不一样。
希望帮助到大家,谢谢!
0 0
- The method setOnClickListener(View.OnClickListener) in the type View is not applicable for the argum
- The method setOnClickListener(View.OnClickListener) in the type View is not applicable for the argum
- The method setOnClickListener(View.OnClickListener) in the type View is not applicable for the argum
- The method setOnClickListener(View.OnClickListener) in the type View is not applicable for the argum
- The method setOnClickListener(View.OnClickListener) in the type View is not applicable for the argum
- The method setOnClickListener(View.OnClickListener) in the type View is not applicable for the argum
- The method setOnClickListener(View.OnClickListener) in the type View is not applicable for the argu
- The method setOnClickListener(View.OnClickListener) in the type View is not applicable for the argum
- The method setOnClickListener(View.OnClickListener) in the type View is not applicable
- android开发The method setOnClickListener(View.OnClickListener) in the type View is not错误
- android The method setOnClickListener(View.OnClickListener) in the type View is not applicable for
- The method setOnClickListener(View.OnClickListener) in the type View is not applicable
- 解决-The method setOnClickListener(View.OnClickListener) in the type View is not 错误
- The method setOnClickListener(View.OnClickListener) in the type View is not
- 力所能及之The method setOnClickListener(View.OnClickListener) in the type View is not
- The method setOnClickListener(View.OnClickListener) in the type View is not
- The method setOnClickListener(View.OnClickListener) in the type View is not
- 解决-The method setOnClickListener(View.OnClickListener) in the type View is not 错误
- gpa HDU 2399
- 项目选择2
- http协议浅谈
- OpenGL 函数 gluLookAt() glScalef() glTranslatef() glRotatef() glFrustum() glPerspective() 的使用
- App开发日报 2015-04-07
- The method setOnClickListener(View.OnClickListener) in the type View is not
- VS2010中正则表达式查找和替换实例
- SICK LMS200激光数据采集程序说明
- VS集成Qt时,VS中的.vcxproj.user 文件相对于Qt的作用
- Json解析之gson
- 利用头文件<string.h>求输入的字符串是否是回文字符串
- freopen重定向
- 激光雷达学习笔记(二)数据读取和显示
- CSS3眨眼效果(animation动画循环间的“暂停”、“延时”执行)