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
解决方案 »
- android初学者求教!!谢谢
- Android开发……Myeclipse中控件get/set 会卡
- 急:关于System property读写问题
- 切换Activity或打开popupwindow然后关闭后原来的activity上的webview失效
- android 学习需要什么基础····
- 关于学习Android!进来指点
- 有关android、webview、js、getElementsByTagName的一个问题
- sos 关于listview的问题求助
- WebView加载html
- android5.0sdk 开发包!!鉴于很多的码农无法翻墙所以特分享出来
- 请问在ANDROID上,如何实现流量统计功能
- SVG在Android项目中如何应用
看一下API文档吧
....
}
改成这样就可以了