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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started