我收到此错误消息
错误:(137,56)错误:不是抽象的 不会覆盖抽象方法 AsyncHttpResponseHandler中的onFailure(int,Header [],byte [],Throwable)
client.post("http://Your Ip Address or Localhost:8080/ImageUploadWebApp/uploading.jsp",
params, new AsyncHttpResponseHandler() {
@Override
public void onSuccess(String response) {
prgDialog.hide();
Toast.makeText(getApplicationContext(), response,
Toast.LENGTH_LONG).show();
}
@Override
public void onFailure(int statusCode, Throwable error,
String content) {
prgDialog.hide();
if (statusCode == 404) {
Toast.makeText(getApplicationContext(),
"Requested resource not found",
Toast.LENGTH_LONG).show();
代码有什么问题?
谢谢
答案 0 :(得分:0)
@James是正确的,您的方法参数不正确,错误消息明确说明了这一点。我不知道你怎么也没有为你的onSuccess出错。
我猜你正在使用loopj异步http库?
mClient.post(null, locationURL, se, "application/json", new AsyncHttpResponseHandler() {
@Override
public void onSuccess(int statusCode, Header[] headers, byte[] responseBody) {
AppLog.d("TAG", "Data post update success");
}
@Override
public void onFailure(int statusCode, Header[] headers, byte[] responseBody, Throwable error) {
AppLog.d("TAG", "Data post update failure");
}
});