
LiveData : A lifecycle aware observable data holder class LiveData의 간단한 소개 이전 글 : dduntorry.tistory.com/entry/Android-LiveData LiveData 소개 LiveData에 대한 안드로이드 공식문서입니다. https://developer.android.com/topic/libraries/architecture/livedata.html LiveData 개요 | Android 개발자 | Android Developers LiveData를 사용하여 수명.. dduntorry.tistory.com 안드로이드에는 3가지 앱 구성요소가 있습니다. Activity, Fragment, Service 이 3가지 앱 구성요소는 L..

ViewModelFactory는 ViewModel을 통해 전달되는 인자가 있을 때 사용됩니다 class MainActivityViewModel( startingTotal: Int ) : ViewModel() { } 위와 같이 전달 인자가 있으면 사용해요 ViewModelFactory 실습 MainActivityViewModel class MainActivityViewModel( startingTotal: Int ) : ViewModel() { private var total=0 init { total = startingTotal } fun getTotal(): Int { return total } fun setTotal(input: Int) { total+=input } } MainActivityView..

Configuration이 destroy 될 때 1. Rotation (portrait landscape) 2. keyboard changes 3. language changes 4. enabling multiwindow ..... ViewModel 생명주기 ViewModel은 ViewModel은 하나의 액티비티, 프래그먼트 혹은 여러개 액티비티, 프래그먼트에 연동됩니다. ViewModel은 액티비티나 프래그먼트의 생명주기동안 살아있다가 Finished 될 때, onCleared() 됩니다. AndroidViewModel vs ViewModel : AndroidViewModel은 memory leak가 발생할 수 있지만 Context를 사용해야 할 때 쓰며, 이 외 상황에서는 개발문서에서도 ViewMod..
DataBinding -findViewById 칠을 없애보자 build.gradle //안드로이드 스튜디오 4.1 이상에서는 아래와 같이 anroid { buildFeatures { dataBinding = true } } //안드로이드 스튜디오 4.1 미만에서는 아래와 같이 anroid { databinding { enabled = true } } activity_main.xml 위와 같이 ConstraintLayout을 layout으로 감싸고 ConstraintLayout에 있던 xmln 부분을 layout으로 이동시킵니다 data class Student( var id: Int, var name: String, var email: String ) 데이터 객체를 쓰고 싶으면 위와같이 data clas..

MVVM(Model View ViewModel) View : 화면에 표현되는 레이아웃에 관여. UI관련 로직을 수행할 수 있습니다. ViewModel : View에게 상태 변화를 전달합니다. 명령은 UI를 통해 동작합니다. ViewModel은 Model은 알지만 View를 모릅니다. View는 ViewModel은 알지만 Model은 모릅니다. View는 ViewModel을 observing하고 있다가 상태 변화가 전달되면 화면을 갱신해야 합니다. 의존적 형태를 없애려면 DataBinding으로 View와 ViewModel을 독립해야 합니다 DataBinding 은 View 와 ViewModel 간의 데이터와 명령을 연결해주는 매개체가 되어 서로의 존재를 알지 못하더라도 interaction을 할 수 있도..

LiveData에 대한 안드로이드 공식문서입니다. https://developer.android.com/topic/libraries/architecture/livedata.html LiveData 개요 | Android 개발자 | Android Developers LiveData를 사용하여 수명 주기를 인식하는 방식으로 데이터를 처리합니다. developer.android.com LiveData는 observer pattern을 따릅니다. /* (observer pattern : observer들의 목록을 객체에 등록하여 상태 변화가 있을 때마다 메서드 등을 통해 객체가 직접 목록의 각 옵저버에게 통지하도록 하는 디자인 패턴입니다.) */ onStart, onResume 인 active 상태일 때만 데이..
- Total
- Today
- Yesterday
- CustomListView
- Eclipse
- 자동로그인
- Kotlin
- ADAPTER
- 톰캣
- MutableLiveData
- 자바
- Enterkey
- Android
- SharedPreferences
- setOnKeyListener
- DataBinding
- kotiln
- 로그인
- ViewModel
- 제어의 역행
- Java
- listview
- 안드로이드
- spring
- livedata
- Framework
- ViewModelFactory
- tomcat
- AOP
- 스택제거
- 스프링
- 이클립스
- POJO
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |