Resetting the Target Amount

This is more of an interim step but is necessary to ensure the menu event handler for the ‘Reset’ option is working correctly.

First, edit Donate.java and introduce an implementation of the ‘reset’ method

  1. @Override
  2. public void reset(MenuItem item)
  3. {
  4. // Your implementation goes here
  5. }

the

  1. @Override

annotation is important - can you explain why?

So add in the code necessary to deal with the Reset Menu option being selected, and reset the totalDonated back to zero (0). You also need to update the Donate UI to reflect this reset, so try and have a go at that too.

Run the app again to confirm that the ‘Reset’ Menu option is now functioning.