添加任务触发通知发送功能。

This commit is contained in:
ZhanGSKen
2025-10-03 11:24:44 +08:00
parent 721a0af8c0
commit f0f248b018
2 changed files with 5 additions and 3 deletions

View File

@@ -1,8 +1,8 @@
#Created by .winboll/winboll_app_build.gradle
#Thu Oct 02 20:29:49 GMT 2025
#Fri Oct 03 03:22:20 GMT 2025
stageCount=8
libraryProject=
baseVersion=15.0
publishVersion=15.0.7
buildCount=53
buildCount=54
baseBetaVersion=15.0.8

View File

@@ -686,7 +686,7 @@ public class MainService extends Service {
* @param bindPos 任务绑定的位置
* @param currentDistance 当前距离
*/
private void sendTaskTriggerNotification(PositionTaskModel task, PositionModel bindPos, double currentDistance) {
private void sendTaskTriggerNotification(final PositionTaskModel task, PositionModel bindPos, double currentDistance) {
if (!_mIsServiceRunning) {
return;
}
@@ -707,11 +707,13 @@ public class MainService extends Service {
// 显示Toast主线程安全调用Java 7 匿名内部类)
if (Looper.myLooper() == Looper.getMainLooper()) {
ToastUtils.show(triggerContent);
NotificationUtil.show(MainService.this, task.getTaskId(), task.getPositionId(), task.getTaskDescription());
} else {
new Handler(Looper.getMainLooper()).post(new Runnable() {
@Override
public void run() {
ToastUtils.show(triggerContent);
NotificationUtil.show(MainService.this, task.getTaskId(), task.getPositionId(), task.getTaskDescription());
}
});
}