Question: For this assignment, you will create a silly little counting app that uses a fragment to display UI elements. In addition to the start up

For this assignment, you will create a silly little counting app that uses a fragment to display UI elements. In addition to the start up activity, include a fragment that uses a layout to display a five Button widgets and an TextView widget.

  • The first Button should display the text "+1", and the string should live in the strings.xml resource file.
  • The second Button should display the text "+5", and the string should live in the strings.xml resource file.
  • The third Button should display "Reset", and the string should live in the strings.xml resource file.
  • The fourth Button should display -1, and the string should live in the strings.xml resource file.
  • The fifth Button should display -5, and the string should live in the strings.xml resource file.
  • The TextView widget should initially display "0".

Every time the user clicks the "+1" button, the number in your TextView widget should increase by 1. Every time the user clicks the "+5" button, the number in your TextView widget should increase by 5. Every time the user clicks the "Reset" button, the number in your TextView widget should be set to 0. Every time the user clicks the "-1" button, the number should decrease by 1. Every time the user clicks the "-5" button, the number should decrease by 5.

So, your app will have an Activity that manages a Fragment that uses it's own separate layout for the View widgets.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!