Skip to content

关于onRefresh方法重写的问题 #55

Description

@FunnyLee

``public interface INewsArticle {

interface View extends IBaseListView<Presenter> {

    /**
     * 请求数据
     */
    void onLoadData();

    /**
     * 刷新
     */
    void onRefresh();
}``

在这个接口中有一个onRefresh方法,但是在这个接口的实现类NewsArticleView中,并没有实现onRefresh方法。但是也没有编译报错。
之后我发现是在BaseListFragment类中,有一个SwipeRefreshLayout.OnRefreshListener监听的onRefresh方法写在里面。
这里有点疑惑?两个方法名虽然一样,但是是两个不同接口里面的方法。为什么不会编译报错?
然后我把SwipeRefreshLayout.OnRefreshListener写成匿名内部类的方式,NewsArticleView类就因为没有实现INewsArticle.View中的onRefresh方法而报错。
大神,求解答,谢谢

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions