We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d6e4d3f commit 67da414Copy full SHA for 67da414
android/src/main/kotlin/com/pravera/flutter_foreground_task/service/ForegroundService.kt
@@ -199,7 +199,10 @@ class ForegroundService : Service() {
199
stopForegroundService()
200
unregisterBroadcastReceiver()
201
202
- val isCorrectlyStopped = foregroundServiceStatus.isCorrectlyStopped()
+ var isCorrectlyStopped = false
203
+ if (::foregroundServiceStatus.isInitialized) {
204
+ isCorrectlyStopped = foregroundServiceStatus.isCorrectlyStopped()
205
+ }
206
val isSetStopWithTaskFlag = ForegroundServiceUtils.isSetStopWithTaskFlag(this)
207
if (!isCorrectlyStopped && !isSetStopWithTaskFlag) {
208
Log.e(TAG, "The service was terminated due to an unexpected problem. The service will restart after 5 seconds.")
0 commit comments