MVVM pattern and startActivity

后端 未结 3 1860
旧时难觅i
旧时难觅i 2020-12-23 13:43

I recently decided to have a closer look at the new Android Architecture Components that Google released, especially using their ViewModel lifecycle-aware class to a MVVM ar

3条回答
  •  抹茶落季
    2020-12-23 14:18

    You can extend your ViewModel from AndroidViewModel, which has the application reference, and start the activity using this context.

提交回复
热议问题