title: Is it possible to make one LiveData of two LiveDatas?
body: <p>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.</p>
  
  <p>ExpenseRepository:</p>
  
  <pre><code>public class ExpenseRepository {
  
  private ExpenseDao expenseDao;
  private LiveData&lt;List&lt;Expense&gt;&gt; allExpenses;
  
  public ExpenseRepository(Application application) {
      ExpenseIncomeDatabase database = ExpenseIncomeDatabase.getInstance(application);
      expenseDao = database.expenseDao();
      allExpenses = expenseDao.getExpensesByDay();
  }
  
  public LiveData&lt;List&lt;Expense&gt;&gt; getAllExpensesByDay() {
      return allExpenses;
  }
  </code></pre>
  
  <p>IncomeRepository:</p>
  
  <pre><code>public class IncomeRepository {
  
  private IncomeDao incomeDao;
  private LiveData&lt;List&lt;Income&gt;&gt; allIncomes;
  
  public IncomeRepository(Application application) {
      ExpenseIncomeDatabase database = ExpenseIncomeDatabase.getInstance(application);
      incomeDao = database.incomeDao();
      allIncomes = incomeDao.getIncomesByDay();
  }
  
  public LiveData&lt;List&lt;Income&gt;&gt; getAllIncomesByDay() {
      return allIncomes;
  }
  </code></pre>
  
  <p>ExpenseDao:</p>
  
  <pre><code>@Dao
  public interface ExpenseDao {
  
  @Query("SELECT * FROM expense_table ORDER BY day") 
  LiveData&lt;List&lt;Expense&gt;&gt; getExpensesByDay();
  </code></pre>
  
  <p>IncomeDao:</p>
  
  <pre><code>@Dao
  public interface IncomeDao {
  
  @Query("SELECT * FROM income_table ORDER BY day") 
  LiveData&lt;List&lt;Income&gt;&gt; getIncomesByDay();
  </code></pre>
  
  <p>DailyViewModel:</p>
  
  <pre><code>public class DailyFragmentViewModel extends AndroidViewModel {
  
  private ExpenseRepository expenseRepository;
  private IncomeRepository incomeRepository;
  private LiveData&lt;Pair&lt;List&lt;Expense&gt;, List&lt;Income&gt;&gt;&gt; combined;
  private ExpenseDao expenseDao;
  private IncomeDao incomeDao;
  
  public DailyFragmentViewModel(@NonNull Application application) {
      super(application);
      expenseRepository = new ExpenseRepository(application);
      incomeRepository = new IncomeRepository(application);
      combined = new DailyCombinedLiveData(expenseDao.getExpensesByDay(), incomeDao.getIncomesByDay());
  }
  
  public LiveData&lt;Pair&lt;List&lt;Expense&gt;, List&lt;Income&gt;&gt;&gt; getExpensesAndIncomes() {
      return combined;
  }
  </code></pre>