mirror of
https://gitea.winboll.cc/ZhanGSKen/MyWinBoLL.git
synced 2026-08-14 05:27:10 +08:00
feat: GPS定位服务增加运行状态查询接口
- GpsReceiveService 新增公共静态函数 isServiceRunning() - SettingsActivity 窗口初始化时查询服务状态并同步开关状态
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
#Created by .winboll/winboll_app_build.gradle
|
||||
#Fri Jul 03 13:02:58 HKT 2026
|
||||
#Mon Jul 06 13:56:29 CST 2026
|
||||
stageCount=2
|
||||
libraryProject=
|
||||
baseVersion=15.20
|
||||
publishVersion=15.20.1
|
||||
buildCount=0
|
||||
buildCount=9
|
||||
baseBetaVersion=15.20.2
|
||||
|
||||
@@ -17,6 +17,7 @@ public class SettingsActivity extends Activity {
|
||||
setContentView(R.layout.activity_settings);
|
||||
|
||||
Switch swGpsService = findViewById(R.id.sw_gps_service);
|
||||
swGpsService.setChecked(GpsReceiveService.isServiceRunning());
|
||||
swGpsService.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
|
||||
@@ -30,6 +30,14 @@ public class GpsReceiveService extends Service {
|
||||
private GpsDbManager dbManager;
|
||||
private BroadcastReceiver gpsBroadcastReceiver;
|
||||
|
||||
/**
|
||||
* 获取GPS定位服务运行状态
|
||||
* @return true=服务正在运行, false=服务未运行
|
||||
*/
|
||||
public static boolean isServiceRunning() {
|
||||
return serviceRunning;
|
||||
}
|
||||
|
||||
/**
|
||||
* 外部统一静态启动服务
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user