Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
FunnyLee opened this issue Sep 5, 2018 · 0 comments
Open

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

FunnyLee opened this issue Sep 5, 2018 · 0 comments

Comments

@FunnyLee
Copy link

FunnyLee commented Sep 5, 2018

``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方法而报错。
大神,求解答,谢谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant