There is a mutableLiveData Holding 2 array "deal" and "category" I need to parse this both in different adapters.
Is there a way I can convert 1 mutable live data to 2 array and then parse them to two different adapters
Suppose There is MutableVariable Name se
private lateinit var mHomePojo: MutableLiveData<List<HomePojo>>
having parse Json as below
{
"status": 0,
"response": "success",
"category": [
{
"categoryName": "demo",
"categoryDesc": "demo"
},
{
"categoryName": "demo1",
"categoryDesc": "demo"
}
],
"deal": [
{
"dealImg": "https://aiotechnology.in/Aditechweb/upload/153102117.jpg",
"dealDesc": "gd",
"dealStartDate": "2019-10-18",
"dealEndDate": "2019-10-19"
}
]
}
Is there any way to parse private lateinit var mHomePojo: MutableLiveData<List<HomePojo>>
to lateinit var mDealModel: MutableLiveData<List<DealModel>>
and
lateinit var mCategoryModel: MutableLiveData<List<CategoryModel>>
I am new to MVVM please help