简体   繁体   English

MainActivity必须声明为抽象或实现接口X

[英]MainActivity must be declared abstract or implement interface X

I have the interface 我有界面

public interface MyInterface {

    public void myTask (ServiceHandler.SongInfo[] songInfo);
}

I have the ServiceHandler.SongInfo class 我有ServiceHandler.SongInfo类

public class SongInfo {
        public String wrapperType;
        public String kind;
        public Integer artistId;
        public Integer collectionId
        //etc
    }

I have the decleration 我有胆识

public class MainActivity extends AppCompatActivity implements MyInterface {

    //... Everything else 

    @Override 
    void myTask(SongInfo[] songInfo){

    }

 }

But I sill get the error unless I comment out this line in my interface 但是除非在我的界面中将此行注释掉,否则我仍然会收到错误消息

public interface MyInterface {

    //public void myTask (ServiceHandler.SongInfo[] songInfo);
}

What does it mean? 这是什么意思?

在实现参数songInfo[]更改为ServiceHandler.SongInfo[]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM