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 |
Tags
- CollapsingToolbarLayout
- Android
- BOJ
- CustomView
- 백준
- Behavior
- 코틀린
- 알고리즘
- notification
- onLayout
- AppBarLayout
- onMeasure
- lifecycle
- CoordinatorLayout
- LiveData
- Navigation
- Coroutine
- 알림
- hilt
- room
- sqlite
- 안드로이드
- DataBinding
- ViewModel
- recyclerview
- kotlin
- activity
- Algorithm
- HTTP
- View
Archives
- Today
- Total
목록callback (1)
개발일지

데이터 미리 채우기 상황에 따라 데이터베이스를 생성할 때 미리 데이터를 채워야 하는 경우나 데이터베이스를 Open할 때 데이터베이스를 조작해야하는 경우가 있다. 데이터베이스에 Callback을 제공하여 이러한 문제를 해결할 수 있다. AppDatabase 데이터베이스를 생성할 때 addCallback을 사용하여 Callback을 추가할 수 있다. @Database(entities = [Drawer::class, ToDo::class], version = 2, exportSchema = true) abstract class AppDatabase : RoomDatabase() { companion object { private var instance: AppDatabase? = null fun getInst..
Android (안드로이드)/Room
2021. 1. 17. 02:35