This Notes is according to the udacity free course :
Android Development for Beginners
Lesson 2A : Add TextViews for Price
===============================
Next Step is to check your app can change "price" on your screen.
First : Add Price and @+id/quantity_text_view to your layout.
Second : copy those code into the MainActivity.java.
paste them here under your left braces
*Under the display method( Like the pic below)
Third: You may notice the NumberFormat was colored in red. Also, displayPrice was colored in gray.
H.W.
Android Development for Beginners
Lesson 2A : Add TextViews for Price
===============================
Next Step is to check your app can change "price" on your screen.
First : Add Price and @+id/quantity_text_view to your layout.
Second : copy those code into the MainActivity.java.
paste them here under your left braces
*Under the display method( Like the pic below)
Third: You may notice the NumberFormat was colored in red. Also, displayPrice was colored in gray.
- NumberFormat : We have to set up "Auto import" so that android studio can recognize them.
- For Windows, go to File > Settings > Editor > General > Auto Import
- For Mac, go to Menu Bar > Android Studio > Preferences > Editor > General > Auto Import
- displayPrice : add displayPrice in the submitOrder.
H.W.
留言
張貼留言