求问内部类
myEdit1.setOnKeyListener(new OnKeyListener(){public boolean onKey(View v,int keyCode,KeyEvent event){
myEdit1.setText("");
return false;
}
});
分别报错如下
//The method setOnKeyListener(View.OnKeyListener) in the type View is not applicable for the arguments (new OnKeyListener(){})
//OnKeyListener cannot be resolved to a type
//KeyEvent cannot be resolved to a type
我是按照书上的代码敲的
为什么会报错呢?
还有我发现一写内部类就会报错
这是为什么呢
求各位大神赐教