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

AndroidDnsServer.defaultResolver(); 缺少参数 #30

Open
Lyrillind opened this issue Jul 7, 2020 · 1 comment
Open

AndroidDnsServer.defaultResolver(); 缺少参数 #30

Lyrillind opened this issue Jul 7, 2020 · 1 comment

Comments

@Lyrillind
Copy link

编译时,AndroidDnsServer.defaultResolver(); 这行代码报错,提示:

        IResolver r1 = AndroidDnsServer.defaultResolver();
                                       ^
  需要: Context
  找到: 没有参数
  原因: 实际参数列表和形式参数列表长度不同

看了源码,需要传入 Context,然而文档里没有提到需要传这个,也没讲如何获取

@YangSen-qn
Copy link
Contributor

@Lyrillind 可以使用getContext()获取上下文,也可以使用getApplicationContext()。

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

2 participants