Error Info:
[color=red][i]The method onFailure(Throwable) of type new AsyncCallback<String>(){} must override a superclass method[/i][/color]
有错误的代码:
出现这种错误是因为在使用googlipse的时候,由IDE自动生成了上面的代码,在两个方法前添加了不该有的@override元数据造成的。去掉这两个元数据,即可。
[color=red][i]The method onFailure(Throwable) of type new AsyncCallback<String>(){} must override a superclass method[/i][/color]
有错误的代码:
image.addClickListener(new ClickListener() {
public void onClick(Widget sender) {
MyFirstService.Util.getInstance().sayHelloTo("shansun123",
new AsyncCallback<String>()
{
@Override
public void onFailure(Throwable caught) {
Window.alert(caught.getMessage());
}
@Override
public void onSuccess(String result) {
Window.alert("Return from MyRemoteService: " + result);
}
});
}
});
出现这种错误是因为在使用googlipse的时候,由IDE自动生成了上面的代码,在两个方法前添加了不该有的@override元数据造成的。去掉这两个元数据,即可。