【Android Development for Beginners】Lesson 2A : Update Quantity Variable, Modify the increment/decrement() Method
This Notes is according to the udacity free course :
Android Development for Beginners
Lesson 2A :
Update Quantity Variable,
Modify the increment() Method,
Modify the decrement() Method
In the last class, we found when we press the button "+" more and more, the coffee quantity just stopped at "4". And we have to figure out how to fix this problem step-by-step in this class.
In this Class we can update the quantity of the coffee by its previous value.
so we create this code in MainActivity.java
The only thing you have to do is to set up the initiate number.
But the problem of automatic increasing quantity is still exist.
H.W
Type the code by yourself, and pay attention on the SPACE and SPACE.
Keep the good hobbit and then it will help you writing codes in the future.
Android Development for Beginners
Lesson 2A :
Update Quantity Variable,
Modify the increment() Method,
Modify the decrement() Method
In the last class, we found when we press the button "+" more and more, the coffee quantity just stopped at "4". And we have to figure out how to fix this problem step-by-step in this class.
In this Class we can update the quantity of the coffee by its previous value.
so we create this code in MainActivity.java
With these code you don't need to count the number by yourself.
The only thing you have to do is to set up the initiate number.
But the problem of automatic increasing quantity is still exist.
H.W
Type the code by yourself, and pay attention on the SPACE and SPACE.
Keep the good hobbit and then it will help you writing codes in the future.
留言
張貼留言