07-02 03:26
Notice
Recent Posts
Recent Comments
07-02 03:26
«   2024/07   »
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
Archives
Today
Total
관리 메뉴

pear

[android] viewmodel binding implementation 본문

android/kotlin

[android] viewmodel binding implementation

pearlab 2023. 7. 11. 10:54

viewmodel binding 할 때 필요한 implementation

implementation 'androidx.activity:activity-ktx:1.2.0'
import androidx.activity.viewModels
private val viewmodel : MainViewModel by viewModels()

 

 

ps activity-ktx 와 의존성이 있는 다른 *-ktx로 대체가 가능하다.

implementation 'androidx.activity:*-ktx:1.2.0'