Skip to content

Commit

Permalink
Moved workManager to class property.
Browse files Browse the repository at this point in the history
  • Loading branch information
hdweiss committed Jan 5, 2025
1 parent 429b31f commit 2904530
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class MainActivity : FragmentActivity() {
private val sessionRepository by inject<SessionRepository>()
private val userRepository by inject<UserRepository>()
private val screensaverViewModel by viewModel<ScreensaverViewModel>()
private val workManager by inject<WorkManager>()

private lateinit var binding: ActivityMainBinding

Expand Down Expand Up @@ -107,7 +108,6 @@ class MainActivity : FragmentActivity() {
override fun onStop() {
super.onStop()

val workManager by inject<WorkManager>()
workManager.enqueue(OneTimeWorkRequestBuilder<LeanbackChannelWorker>().build())

lifecycleScope.launch {
Expand Down

0 comments on commit 2904530

Please sign in to comment.