From 321e19aa1698c2162eb01984f92936c863fe2ba1 Mon Sep 17 00:00:00 2001 From: yjj38 Date: Mon, 14 Jul 2025 14:34:49 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=B7=BB=E5=8A=A0=20Firebase=20Crashl?= =?UTF-8?q?ytics=20=E9=85=8D=E7=BD=AE=E5=B9=B6=E8=B0=83=E6=95=B4=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E8=AE=BE=E7=BD=AE-=20=E5=9C=A8=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E4=B8=AD=E6=B7=BB=E5=8A=A0=20Firebase=20Crashlytics=20?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6=20-=E7=A7=BB=E9=99=A4=20mi?= =?UTF-8?q?sc.xml=20=E4=B8=AD=E7=9A=84=20XML=E5=A3=B0=E6=98=8E=20-=20?= =?UTF-8?q?=E5=9C=A8=20StartJobService=20=E4=B8=AD=E6=B7=BB=E5=8A=A0=20onE?= =?UTF-8?q?vent=20=E5=87=BD=E6=95=B0=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/appInsightsSettings.xml | 26 +++++++++++++++++++ .idea/misc.xml | 1 - .../example/studyapp/job/StartJobService.kt | 6 +++++ 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 .idea/appInsightsSettings.xml diff --git a/.idea/appInsightsSettings.xml b/.idea/appInsightsSettings.xml new file mode 100644 index 0000000..371f2e2 --- /dev/null +++ b/.idea/appInsightsSettings.xml @@ -0,0 +1,26 @@ + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index e483b6f..2731899 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,4 +1,3 @@ - diff --git a/app/src/main/java/com/example/studyapp/job/StartJobService.kt b/app/src/main/java/com/example/studyapp/job/StartJobService.kt index d70ac6f..7be8e1d 100644 --- a/app/src/main/java/com/example/studyapp/job/StartJobService.kt +++ b/app/src/main/java/com/example/studyapp/job/StartJobService.kt @@ -130,6 +130,12 @@ class StartJobService : JobIntentService() { private var running = false + /** + * onEvent 是一个函数,接收 Context 参数。 + * 使用 enqueueWork 方法启动一个 StartJobService 类型的后台任务。 + * jobId 是任务的唯一标识符。 + * 创建了一个 Intent,用于指定要启动的服务为 StartJobService。 + */ fun onEvent(context: Context) { enqueueWork( context,