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
- Android
- CollapsingToolbarLayout
- DataBinding
- 알고리즘
- CoordinatorLayout
- 알림
- activity
- onMeasure
- ViewModel
- 코틀린
- View
- Behavior
- BOJ
- 안드로이드
- Algorithm
- kotlin
- recyclerview
- lifecycle
- CustomView
- HTTP
- room
- 백준
- AppBarLayout
- sqlite
- Navigation
- hilt
- LiveData
- notification
- onLayout
- Coroutine
Archives
- Today
- Total
개발일지
삽질 - Android ForegroundService 본문
권한설정
Oreo이상에서 ForegroundService는 권한이 필요하다.
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
startForeground
startForeground에서 id값은 0이면 안된다.
오류
startForeground(0, NotificationCompat.Builder(this, NOTIFICATION_CHANNEL_ID).build())
해결
startForeground(1, NotificationCompat.Builder(this, NOTIFICATION_CHANNEL_ID).build())
'삽질' 카테고리의 다른 글
삽질 - SQLite Add Foreign Key (0) | 2021.01.18 |
---|---|
삽질 - Android CoordinatorLayout Floating Action Button (0) | 2020.12.10 |
삽질 - CoordinatorLayout RecyclerView (0) | 2020.12.09 |
삽질 - Android CollapsingToolbarLayout Title (0) | 2020.12.09 |
삽질 - Android Scroll View Child View match_parent (0) | 2020.12.04 |
Comments