简体   繁体   English

错误:匿名类不是抽象的,并且不覆盖抽象方法

[英]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.

相关问题 匿名类不是抽象的,并且不覆盖抽象方法 - anonymous class is not abstract and does not override abstract method 错误:类不是抽象的,并且不覆盖抽象方法 - ERROR: class not abstract and does not override abstract method 错误:类不是抽象的,并且不覆盖抽象方法 - error: Class is not abstract and does not override abstract method 错误:“ <Class> 不是抽象的,并且不覆盖抽象方法 <method> ” - Error: “<Class> is not abstract and does not override abstract method <method>” 类不是抽象的,并且不覆盖抽象方法Java错误TIcTacToe游戏 - class is not abstract and does not override abstract method java error TIcTacToe game ClickableSpan - 类不是抽象的,不会覆盖抽象方法 - ClickableSpan - Class is not abstract and does not override abstract method 类不是抽象的,并且不会覆盖超类中的抽象方法 - Class is not abstract and does not override abstract method in superclass 类不抽象,不覆盖抽象方法问题 - Class is not abstract and does not override abstract method problem 类不是抽象的,并且不会覆盖抽象方法 - Class is not abstract and does not override abstract method 用抽象编译错误,并且不覆盖抽象方法 - Compile error with abstract and does not override abstract method
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM