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,