应用服务启动后延迟2秒执行提醒任务

This commit is contained in:
ZhanGSKen
2025-05-03 14:01:56 +08:00
parent 55ce968053
commit 482c007481
2 changed files with 15 additions and 5 deletions

View File

@@ -32,6 +32,8 @@ import cc.winboll.studio.powerbell.utils.AppConfigUtils;
import cc.winboll.studio.powerbell.utils.NotificationHelper;
import cc.winboll.studio.powerbell.utils.ServiceUtils;
import cc.winboll.studio.powerbell.utils.StringUtils;
import android.os.Handler;
import android.os.Looper;
public class ControlCenterService extends Service {
@@ -114,9 +116,17 @@ public class ControlCenterService extends Service {
mControlCenterServiceReceiver = new ControlCenterServiceReceiver(this);
mControlCenterServiceReceiver.registerAction(this);
}
startRemindThread(mAppConfigUtils.mAppConfigBean);
ToastUtils.show("Service Is Start.");
LogUtils.i(TAG, "Service Is Start.");
new Handler(Looper.getMainLooper()).postDelayed(new Runnable(){
@Override
public void run() {
startRemindThread(mAppConfigUtils.mAppConfigBean);
ToastUtils.show("Service Is Start.");
LogUtils.i(TAG, "Service Is Start.");
}
}, 2000);
}
}