![]() ![]() Fragments can share a viewmodel using their activity scope to handle communication between each other. Viewmodel is a helper class designed to manage UI related data in a life-cycle conscious way.It is responsible for preparing data for the UI and therefore helps to separate the view from business logics. This post demonstrates how to pass data between two fragments using both viewmodel and Bundle.īundle is used to pass data between both activities and fragments, it maps values to String keys and then uses the key to retrieve the value. It comes with a lot of benefits which includes handling fragment transaction,control back stack by default, viewmodel support which I'm going to be explaining in this post Its purpose is to have only one activity that serves as an entry point to your application using fragment for all UI screen. ![]() Navigation Component is one of the Android jetpacks library. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |