Room database: getting SELECT MAX() twice after creating new RecyclerView item
问题 I have a RecyclerView list of CardView items that is working properly. Upon creation of a new CardView that is inserted into the database, I would like to fire a Toast that informs the user that the CardView was successfully added and show the CardView number. The CardView number is the Id of the CardView item inserted into the database. The data is saved to the database when the user clicks on a Save button that fires onClickSave(). I set up an @Query in the Dao to get the MAX(cardId): Dao .