android - 如何在android中显示位置设置对话框?

标签 android android-studio gps location google-play-services

从 google i/o 2015 我了解到 google play 服务中有一个新对话框,用户无需退出当前应用程序即可打开位置。这是下图,显示了它的外观:

enter image description here

现在我的问题是,如何在我的项目中实现它?我已搜索但未找到任何有效答案,请帮助!

最佳答案

看看google service documetation对于 api 的 你会发现一切都有据可查。 根据您的要求,我建议使用 LocationSettingsRequest.Builder实现您的目标。

我在 stackoverflow 中找到了一个 Kai 的例子:Link

关于android - 如何在android中显示位置设置对话框?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30619114/

相关文章:

android-studio - org.gradle.execution.MultipleBuildFailures : Build completed with 1 failures in Android Studio

java - AppBarLayout 自动完成当用户停止滚动时展开/折叠

android - 如何在 View 上模拟橡皮擦?

Android Studio 不会为调试构建的代码签名

java - setText 不向 TextView 显示值

java - 获取日出日落时间

android - 两个应用程序同时访问 GPS

c# - Windows Mobile 6 GPS 精度

java - Android Studio 确定 GitHub 的凭据无效

android - 计算2天android之间的时差