[英]Cannot resolve android.net.SntpClient class
I am trying to use the class SntpClient that should be in the android.net package, but Android Studio is telling me it cannot find it. 我正在尝试使用应该在android.net软件包中的SntpClient类,但是Android Studio告诉我找不到它。 Indeed when I look through the source jars (of both API 19 and API 21), the class is not there.
确实,当我浏览(API 19和API 21的)源jar时,该类不存在。 However according to grepcode it should be.
但是根据grepcode它应该是。
http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/4.4.4_r1/android/net/SntpClient.java http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/4.4.4_r1/android/net/SntpClient.java
What am I doing wrong? 我究竟做错了什么?
Google has chosen not to make all public classes available as part of the SDK. Google选择不将所有公共类作为SDK的一部分提供。 Visibility is controlled by the @hide comment tag as described here .
能见度由@hide注释标记控制此处描述 。
I'm not sure why they chose to hide SntpClient particularly, but provided you respect the terms of the Apache license you can copy the source into your application without much modification. 我不确定他们为什么选择特别隐藏SntpClient,但是只要您尊重Apache许可的条款,就可以在不做太多修改的情况下将源代码复制到应用程序中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.