The method setOnClickListener(View.OnClickListener) in the type View is not applicable for the arguments (PinGou)代码
public class PinGou extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button goubutton=(Button)findViewById(R.id.goubutton);
goubutton.setOnClickListener(this);
}不懂了求教
public class PinGou extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button goubutton=(Button)findViewById(R.id.goubutton);
goubutton.setOnClickListener(this);
}不懂了求教
解决方案 »
- 各位大神,开发移动广告SDK,向多盟,有米之类的需要多少人马啊,需求怎样的架构师和人员
- Android从服务器获取数据,一次能最大接收多大的数据?
- 能否判断上页的Activity是否已关闭?
- Failed to install Location.apk on device 'I8979eba851a': timeout
- 关于View的尺寸比Layout大的问题
- 请问怎么得到ListView指定position的CheckBox?
- 自定义ViewGroup与ScrollView 不能共存?
- 如何给Button设置特效
- SurfaceView问题
- 如何中断任务ffmpeg动态库执行中的任务?该调用哪个方法?
- 新手提问:要在软件开启的时候像androidQQ那样有一幅图片显示一段时间后再进入主界面如何实现?
- Android 如何逐渐显示一张圆形图片?
改成
public class PinGou extends Activity implements OnClickListener然后,在PinGou中实现OnClickListener中声明的onClick(View view)方法即可。
public class PinGou extends Activity implements OnClickListener{
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button goubutton=(Button)findViewById(R.id.goubutton);
goubutton.setOnClickListener(this);
}
@Override
public void onClick(View v)
{
//单击后你该做的事
}