Wiring the CaptureClaimActivity events
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.javafile in Android Studio. - Now, declare a new field in the class (before the
onCreatemethod) for theDatePickerWrapperthat you wrote (Android Studio can help by writing the import for you):
private DatePickerWrapper selectedDate;
- You'll note that (by default) the
FloatingActionButtonobject 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 with your own action",
Snackbar.LENGTH_LONG
).setAction("Action", null).show();
}
});- This is how many once...