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

LiveData LiveData는 Data를 Observer 패턴으로 관찰하여 변화가 있을 때 업데이트하는 코드를 작성할 수 있다. 일반적인 Observer패턴과 다르게 LiveData는 Activity나 Fragment의 생명주기를 관찰하여 활동 상태(STARTED, RESUMED)일 때만 업데이트한다. dependency dependencies { def lifecycle_version = "2.2.0" // LiveData implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle_version" } 장점 UI와 데이터 상태의 일치 보장 Observer패턴을 따르기 때문에 Observer코드에 UI를 변경하는 코드를 삽입하면 데이터와 ..
Android (안드로이드)/Lifecycle
2021. 2. 6. 08:17