Creating the Overview activity
The travel claim example app needs a nice overview activity to tie together the allowance overview, a list of the claim items, and a way for the user to create new claim items. As we have a Room database, things can become significantly more decoupled, and that's a really good thing. Having a central reactive source of data allows different parts of your application to always reflect the actual state of the application as it changes, without having to coordinate with each other.
The first part of building the OverviewActivity
is creating the Activity
class itself and populating it with the claim items that the user has entered. Follow these steps to create a skeleton OverviewActivity
and register it as the main Activity
for the application:
- Start by right-clicking on your main package (that is,
com.packtpub.claim
) and selectingNew |
Activity |
Empty Activity
from the menu.
- Name the new class
OverviewActivity
. - Leave all the other fields as their defaults and select...