I have two DAOs, two Repositories and two POJOs. There is some way to create one Livedata of two? I need it to make single list for Recyclerview. POJOs are similar objects.<
Let's say you want to merge LiveData & >
LiveData then, you'll need to take >
MediatorLiveData (why? because, both of your live data are of different types).
So, use code like below :
LiveData liveData1 = getAllExpensesByDay();
LiveData liveData2 = getAllIncomesByDay();
MediatorLiveData liveDataMerger = new MediatorLiveData
If you need to use specific data from MediatorLiveData then use Transformations on that.
Check out more here