Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | |||||
| 3 | 4 | 5 | 6 | 7 | 8 | 9 |
| 10 | 11 | 12 | 13 | 14 | 15 | 16 |
| 17 | 18 | 19 | 20 | 21 | 22 | 23 |
| 24 | 25 | 26 | 27 | 28 | 29 | 30 |
| 31 |
Tags
- 백준
- Gradle
- pandas
- TEST
- Compose
- 암호학
- Coroutine
- Python
- Kotlin
- architecture
- MyVoca
- GitHub
- Codeforces
- android
- ProGuard
- relay
- 코루틴
- Hilt
- 코드포스
- Rxjava
- textfield
- 프로그래머스
- activity
- 쿠링
- androidStudio
- boj
- MiTweet
- AWS
- livedata
- Coroutines
Archives
- Today
- Total
목록Channel (1)
이동식 저장소
[Android] 백그라운드 작업을 하나씩 처리하는 방법
백그라운드 작업 ``MealWork``와 ``ScheduleWork``를 정의했고, 현재 실행되고 있는 백그라운드 작업의 수를 세기 위해 Preferences DataStore에 정수형 값 ``RUNNING_WORKS_COUNT``를 정의했다. ``MealWork``와 ``ScheduleWork``가 실행될 때 count를 1 증가시키고, 작업이 끝날 때 count를 1 감소시키는 코드를 작성했다. 대략 다음과 같다. // MealWorker, ScheduleWorker override suspend fun doWork(): Result { preferencesRepository.increaseRunningWorkCount() // do background work preferencesRepository..
Primary/Android
2022. 11. 8. 08:37