Kar*_*iya 10
看看上面的评论线程似乎可以以编程方式关闭GPS(但只能看到12个Upvotes)
但是,如果您以编程方式从应用程序关闭GPS,如果其他应用程序使用GPS服务怎么办?
该解决方案会像
打开Settingsandroid然后告诉用户在退出应用程序时关闭GPS ...
为此您可以这样做:
Intent i = new Intent(android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS);
startActivity(i);
Run Code Online (Sandbox Code Playgroud)
要么
你可以试试
locationManager.removeUpdates(myLocationListener);
locationManager = null;
Run Code Online (Sandbox Code Playgroud)
此关闭此应用程序的gps,但仍可供其他应用程序使用.
| 归档时间: |
|
| 查看次数: |
7360 次 |
| 最近记录: |