package a.cn;import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
public class a extends Activity implements OnClickListener
{
@Override
public void OnClick(View v) {
new AlertDialog.Builder(this).setIcon(R.drawable.icon).
setTitle("提示").setPositiveButton("确定",
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub
new AlertDialog.Builder(a.this).setMessage("确认清空").create().show();
}
}).setNegativeButton("取消",
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub
new AlertDialog.Builder(a.this).setMessage("取消操作").create().show();
}}
).show();
}
@Override
public void OnCreate(Bundle ca) {
super.onCreate(ca);
setContentView(R.layout.main);
Button btnFuck=(Button)findViewById(R.id.btnFuck);
btnFuck.setOnClickListener(this);
}
}
错误信息:
Description Resource Path Location Type
The method OnClick(View) of type a must override or implement a supertype method a.java /a/src/a/cn line 13 Java Problem
The method OnCreate(Bundle) of type a must override or implement a supertype method a.java /a/src/a/cn line 36 Java Problem
The method setOnClickListener(View.OnClickListener) in the type View is not applicable for the arguments (a) a.java /a/src/a/cn line 41 Java Problem
The type a must implement the inherited abstract method DialogInterface.OnClickListener.onClick(DialogInterface, int) a.java /a/src/a/cn line 10 Java Problem
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
public class a extends Activity implements OnClickListener
{
@Override
public void OnClick(View v) {
new AlertDialog.Builder(this).setIcon(R.drawable.icon).
setTitle("提示").setPositiveButton("确定",
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub
new AlertDialog.Builder(a.this).setMessage("确认清空").create().show();
}
}).setNegativeButton("取消",
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub
new AlertDialog.Builder(a.this).setMessage("取消操作").create().show();
}}
).show();
}
@Override
public void OnCreate(Bundle ca) {
super.onCreate(ca);
setContentView(R.layout.main);
Button btnFuck=(Button)findViewById(R.id.btnFuck);
btnFuck.setOnClickListener(this);
}
}
错误信息:
Description Resource Path Location Type
The method OnClick(View) of type a must override or implement a supertype method a.java /a/src/a/cn line 13 Java Problem
The method OnCreate(Bundle) of type a must override or implement a supertype method a.java /a/src/a/cn line 36 Java Problem
The method setOnClickListener(View.OnClickListener) in the type View is not applicable for the arguments (a) a.java /a/src/a/cn line 41 Java Problem
The type a must implement the inherited abstract method DialogInterface.OnClickListener.onClick(DialogInterface, int) a.java /a/src/a/cn line 10 Java Problem
解决方案 »
- 大神啊,求助啊,eclipse 修改完数据库就成这样了到底怎么了
- 请教这样一个布局该怎么写?谢谢
- 为什么用network获取位置信息时会报错这个错?
- 请教:关于ImageButton
- Android中Thread类的问题
- 第一次安装android sdk,packages要全勾选吗?
- 手机跨平台开发用什么语言比较好 C++ 还是 erlang? C++ 和erlang 有什么 区别?谢谢!哪个做跨平台简单快?
- android当内存数据很大的时候,如何能优化内存,提高运行速度
- activity跳转后第二个activity,actionbar显示不全
- android System_server进成的GC线程卡死,无法退出GC
- 请问在ANDROID上,如何实现流量统计功能
- SVG在Android项目中如何应用
看一下API文档吧
....
}
改成这样就可以了