[英]Error: anonymous class is not abstract and does not override abstract method
Please, I am getting an error in the method below whenever I try to build my android project. 请,每当我尝试构建我的android项目时,我都会在下面的方法中遇到错误。
Method : 方法 :
query.findInBackground(new FindCallback() {
@Override
public void done(List<ParseObject> objects, ParseException e) {
mProgressBar.setVisibility(View.INVISIBLE);
if (e == null) {
objects = removeCurrentUser(objects);
mUsers = objects.toArray(new ParseObject[0]);
// Get user relations
ParseRelation userRelations = ParseUser.getCurrentUser().getRelation("UserRelation");
userRelations.getQuery().findInBackground(new FindCallback() {
@Override
public void done(List<ParseObject> results, ParseException e) {
if (e == null) {
UsersAdapter adapter = new UsersAdapter(SelectUsersActivity.this, mUsers, new ArrayList<ParseObject>(results));
setListAdapter(adapter);
}
else {
Log.e(TAG, "Exception caught!", e);
}
}
});
}
else {
// Something went wrong.
Toast.makeText(SelectUsersActivity.this, "Sorry, there was an error getting users!", Toast.LENGTH_LONG).show();
}
}
}//
);
Errors : 错误:
Error:(46, 45) error: is not abstract and does not override abstract method done(List,ParseException) in FindCallback
错误:(46,45)错误:不是抽象的,并且不覆盖FindCallback中的抽象方法done(List,ParseException)
Error:(48, 16) error: name clash: done(List,ParseException) in and done(List,ParseException) in FindCallback have the same erasure, yet neither overrides the other where T is a type-variable: T extends ParseObject declared in interface FindCallback
错误:(48,16)错误:名称冲突:FindCallback中的done(List,ParseException)和done(List,ParseException)具有相同的擦除,但是两个都不覆盖另一个,其中T是类型变量:T扩展了声明的ParseObject声明在接口FindCallback中
Here is Screenshot 这是截图
You haven't parameterized your anonymous FindCallback
subclass, so your done
signature doesn't match the FindCallback#done
signature because the done
signature in the un-parameterized version is done(List<Object>results, ParseException e)
. 您尚未参数化匿名
FindCallback
子类,因此您done
签名与FindCallback#done
签名不匹配,因为未参数化版本中的done
签名已经done(List<Object>results, ParseException e)
。
To fix it, parameterize it: 要对其进行修复,请对其进行参数化:
userRelations.getQuery().findInBackground(new FindCallback<ParseObject>() {
// Add ---------------------------------------------------^^^^^^^^^^^^^
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.