报错:The method setOnClickListener(View.OnClickListener) in the type View is not applicable for the ar
来源:互联网 发布:促进身高的运动 知乎 编辑:程序博客网 时间:2024/05/16 13:39
<span style="font-family: CourierNewPS-BoldMT; font-size: 9pt;"></span><pre name="code" class="java">Button button1 = (Button) findViewById(R.id.button_1);button1.setOnClickListener(new OnClickListener() {@Overridepublic void onClick(View v) {Toast.makeText(FirstActivity.this, "You clicked Button 1",Toast.LENGTH_SHORT).show();}});
引入的类不对:
import android.content.DialogInterface.OnClickListener;
应该是View类里面的OnClickListener
import android.view.View.OnClickListener;
0 0
- 报错 The method setOnClickListener(View.OnClickListener) in the type View is not applicable for the ar
- 报错:The method setOnClickListener(View.OnClickListener) in the type View is not applicable for the ar
- 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
- 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 applicable
- android开发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
- n个节点,m个相互连接的边,边为a【m】,求最短路径
- ubuntu中添加和删除源
- Linux(centOS):Exception in thread "main" java.lang.UnsupportedClassVersionError***
- Android中AsyncTask简单实例操作
- tomcat使用memcached完成集群
- 报错:The method setOnClickListener(View.OnClickListener) in the type View is not applicable for the ar
- VIM 配色方案
- Windows 10 UWP 新内容
- Rotate Array 数组旋转 leetcode
- leetcode 10: Regular Expression Matching
- TextureRect类
- NSTimer的使用Demo
- Simple way to identify iOS user agent in a jQuery if/then statement?
- 欢迎使用CSDN-markdown编辑器