添加任务触发通知发送功能。
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
#Created by .winboll/winboll_app_build.gradle
|
#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
|
stageCount=8
|
||||||
libraryProject=
|
libraryProject=
|
||||||
baseVersion=15.0
|
baseVersion=15.0
|
||||||
publishVersion=15.0.7
|
publishVersion=15.0.7
|
||||||
buildCount=53
|
buildCount=54
|
||||||
baseBetaVersion=15.0.8
|
baseBetaVersion=15.0.8
|
||||||
|
|||||||
@@ -686,7 +686,7 @@ public class MainService extends Service {
|
|||||||
* @param bindPos 任务绑定的位置
|
* @param bindPos 任务绑定的位置
|
||||||
* @param currentDistance 当前距离
|
* @param currentDistance 当前距离
|
||||||
*/
|
*/
|
||||||
private void sendTaskTriggerNotification(PositionTaskModel task, PositionModel bindPos, double currentDistance) {
|
private void sendTaskTriggerNotification(final PositionTaskModel task, PositionModel bindPos, double currentDistance) {
|
||||||
if (!_mIsServiceRunning) {
|
if (!_mIsServiceRunning) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -707,11 +707,13 @@ public class MainService extends Service {
|
|||||||
// 显示Toast(主线程安全调用,Java 7 匿名内部类)
|
// 显示Toast(主线程安全调用,Java 7 匿名内部类)
|
||||||
if (Looper.myLooper() == Looper.getMainLooper()) {
|
if (Looper.myLooper() == Looper.getMainLooper()) {
|
||||||
ToastUtils.show(triggerContent);
|
ToastUtils.show(triggerContent);
|
||||||
|
NotificationUtil.show(MainService.this, task.getTaskId(), task.getPositionId(), task.getTaskDescription());
|
||||||
} else {
|
} else {
|
||||||
new Handler(Looper.getMainLooper()).post(new Runnable() {
|
new Handler(Looper.getMainLooper()).post(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
ToastUtils.show(triggerContent);
|
ToastUtils.show(triggerContent);
|
||||||
|
NotificationUtil.show(MainService.this, task.getTaskId(), task.getPositionId(), task.getTaskDescription());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user