Now that we have a way for the user to pick a date for their travel expense claims, we need to actually wire it into the CaptureClaimActivity, which is where all the logic and wiring for the screen will live. To start wiring the events for the CaptureClaimActivity, follow these steps:
- Open the CaptureClaimActivity.java file in Android Studio.
- Now, declare a new field in the class (before the onCreate method) for the DatePickerWrapper that you wrote (Android Studio can help by writing the import for you):
private DatePickerWrapper selectedDate;
- You'll note that (by default) the FloatingActionButton object is wired up with a simple anonymous event handler that will look something like this:
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Snackbar.make(
view,
"Replace...