Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
任何人都可以建议我如何计算 android 应用程序中的高度。
我正在使用“GoogleApiClient”并在 onLocationChanged(Location location) 中调用方法 location.getAltitude(),但总是得到 0.0,
任何人都可以建议上面的 api 是否返回正确的值或有任何其他方法来计算高度?
首先检查LocationProvider.supportsAltitude(),然后检查Location.hasAltitude()它是否返回 true ,而不是得到一些高度而不是 0.0 。
LocationProvider.supportsAltitude()
Location.hasAltitude()