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);
}不懂了求教
解决方案 »
- android apk java混淆加密 分享一下,欢迎探讨
- android是否可以动态产生按钮
- Android平台应用流量统计开发求助
- camera设置中将图片存储成.raw格式
- Listview每个item中包含fragment,适配器怎么写
- 关于View多次layout后被系统recycle掉的问题!
- 使用git clone 时 出错
- 这个错在哪里?和课本一样的,新建一个类又不能用private
- ListView滚动重复
- Android 短信拦截,真机测试总是无法拦截到
- 新手提问:要在软件开启的时候像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)
{
//单击后你该做的事
}