Diary Detail Activity - (b). Write Code

8 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$15
List Price:  $69.99
You save:  $54.99
€13.91
List Price:  €64.94
You save:  €51.02
£11.91
List Price:  £55.57
You save:  £43.66
CA$20.41
List Price:  CA$95.27
You save:  CA$74.85
A$23.12
List Price:  A$107.88
You save:  A$84.76
S$20.26
List Price:  S$94.55
You save:  S$74.29
HK$117.35
List Price:  HK$547.57
You save:  HK$430.22
CHF 13.59
List Price:  CHF 63.42
You save:  CHF 49.83
NOK kr162.80
List Price:  NOK kr759.63
You save:  NOK kr596.82
DKK kr103.81
List Price:  DKK kr484.38
You save:  DKK kr380.57
NZ$25.17
List Price:  NZ$117.46
You save:  NZ$92.28
د.إ55.08
List Price:  د.إ257.02
You save:  د.إ201.93
৳1,646.57
List Price:  ৳7,682.93
You save:  ৳6,036.35
₹1,251.05
List Price:  ₹5,837.41
You save:  ₹4,586.36
RM70.99
List Price:  RM331.26
You save:  RM260.26
₦21,278.55
List Price:  ₦99,285.71
You save:  ₦78,007.16
₨4,171.92
List Price:  ₨19,466.20
You save:  ₨15,294.27
฿547.20
List Price:  ฿2,553.28
You save:  ฿2,006.07
₺484.86
List Price:  ₺2,262.39
You save:  ₺1,777.52
B$74.88
List Price:  B$349.43
You save:  B$274.54
R286.31
List Price:  R1,335.92
You save:  R1,049.61
Лв27.10
List Price:  Лв126.45
You save:  Лв99.35
₩20,281.68
List Price:  ₩94,634.34
You save:  ₩74,352.65
₪55.30
List Price:  ₪258.03
You save:  ₪202.73
₱845.17
List Price:  ₱3,943.57
You save:  ₱3,098.40
¥2,271.89
List Price:  ¥10,600.67
You save:  ¥8,328.77
MX$248.93
List Price:  MX$1,161.53
You save:  MX$912.59
QR54.65
List Price:  QR255
You save:  QR200.35
P205.65
List Price:  P959.59
You save:  P753.94
KSh1,972.50
List Price:  KSh9,203.68
You save:  KSh7,231.18
E£709.50
List Price:  E£3,310.52
You save:  E£2,601.02
ብር852.18
List Price:  ብር3,976.27
You save:  ብር3,124.09
Kz12,543.16
List Price:  Kz58,526.41
You save:  Kz45,983.24
CLP$14,698.20
List Price:  CLP$68,581.80
You save:  CLP$53,883.60
CN¥108.45
List Price:  CN¥506.04
You save:  CN¥397.59
RD$888.31
List Price:  RD$4,144.87
You save:  RD$3,256.56
DA2,023.82
List Price:  DA9,443.17
You save:  DA7,419.34
FJ$33.92
List Price:  FJ$158.28
You save:  FJ$124.35
Q116.99
List Price:  Q545.87
You save:  Q428.88
GY$3,138.84
List Price:  GY$14,645.83
You save:  GY$11,506.99
ISK kr2,092.20
List Price:  ISK kr9,762.20
You save:  ISK kr7,670
DH151.99
List Price:  DH709.20
You save:  DH557.21
L264.52
List Price:  L1,234.28
You save:  L969.76
ден855.40
List Price:  ден3,991.30
You save:  ден3,135.90
MOP$120.89
List Price:  MOP$564.10
You save:  MOP$443.20
N$284.04
List Price:  N$1,325.35
You save:  N$1,041.31
C$552.22
List Price:  C$2,576.69
You save:  C$2,024.46
रु2,000.54
List Price:  रु9,334.54
You save:  रु7,334
S/55.63
List Price:  S/259.58
You save:  S/203.94
K57.41
List Price:  K267.89
You save:  K210.47
SAR56.25
List Price:  SAR262.49
You save:  SAR206.23
ZK378.45
List Price:  ZK1,765.85
You save:  ZK1,387.40
L69.22
List Price:  L322.98
You save:  L253.76
Kč352.64
List Price:  Kč1,645.46
You save:  Kč1,292.81
Ft5,509.90
List Price:  Ft25,709.21
You save:  Ft20,199.31
SEK kr160.71
List Price:  SEK kr749.87
You save:  SEK kr589.16
ARS$12,866.31
List Price:  ARS$60,034.20
You save:  ARS$47,167.89
Bs103.66
List Price:  Bs483.70
You save:  Bs380.04
COP$58,143.36
List Price:  COP$271,296.95
You save:  COP$213,153.58
₡7,625.61
List Price:  ₡35,581.11
You save:  ₡27,955.50
L370.35
List Price:  L1,728.07
You save:  L1,357.72
₲110,681.92
List Price:  ₲516,441.87
You save:  ₲405,759.95
$U567.34
List Price:  $U2,647.22
You save:  $U2,079.87
zł60.11
List Price:  zł280.50
You save:  zł220.38
Already have an account? Log In

Transcript

Okay, so the next activity that you're going to come to is this activity occurring detail activity. Of course, we have the UI package inspectable. So this is the activity that is being responsible for rendering of course data. So if these are clicks a single item in our recycler view, then of course, we're going to render those chairs in this particular view, okay, or this particular activity. So, we're going to start by writing our inputs. So and to read content with context, and to do better, okay, so make them part of Kosovo jets menu, as well as me flutter.

Then of course, our view them and to do to get the text input and credits are compatible with a computer activity. So we'll proceed Add inputs. public class little activity extends app compat activity implements view that onClick listener. So these are inputs feature, you can see the include the widgets. And we've also added on to the components recall app compat activity, the newest of all material components, like the corruption toolbar, as well as the floating action button feature, okay? no desire for more productivity and then implemented this particular interface, they'll quickly snap differently.

So, we're going to go ahead and define the instances, which are modality widgets, which are going to be rendered in this particular activity. So Command C, go to define our instances. So private TextView total TV description TV A private 14 option button, then private dairy, dairy, private, collapsing to burnout and collapsing to burnout. So these are going to be our widgets, you can see we have three title, description as well as the date, the use of our floating action button better. And then of course, the dairy, which we're supposed to render in this particular activity, we're going to hold it in this object, okay, then collapsing toolbar layout. This is going to be crucial to our collapsing toolbar layout, which I'm going to show in this particular tivity.

So having defined this particular widgets, we now need to come and then initialize them using our friend foo by ID. So let's initialize our widgets. We can say private void, initialize widgets, then come and say total TV equal to find view by ID R. Title, Description TV, our ID, description TV, then the TV, our ID, TV, then addict sub ID sub, then edit, set a click listener this then collapsing toolbar layout or ad collapsing toolbar layout. So the method we're going to define Next is the method which is going to be responsible for actually receiving as well as rendering our data okay. So let's come define it. So we can say who will receive and then show our data to the appropriate system and see predict food receiver should deter, they will come and say, receive their equal two liters will receive dairy, then get our intent.

The detail activity did this Then if you see Gary is not called then Taito TV the text received during the character, then description TV the set text description, then the TV set text received sorry, get that then encrypts into by note the data received during the greater than m corruption to bailout the expandable penetrator color, that resources get color or good color tweet. So clearly you can see the receipt receipt there is a method to do it differently now utils class, of course, it's a method that is allowing us to receive Of course, our dairy and that their object will be seated. Okay, so we have that method. Okay, you can see Then intent that is the key. Okay, so yeah, that's how we're receiving our data and then we now just obtain its title description and it should be greater in our various widgets. So our next step will be now to override Of course two methods, which are related to a menu.

First we'll go to footer menu and then of course, listen to the ministry menu selection difference. Let's come to that. So we're going to inflate Of course our menu for digital pitch will come in and then public button on click Options menu. Menu menu didn't come and say get menu inflator didn't fit our menu, detail pitch menu, the menu, then return true. Then the next thing of course when a menu item is selected, We're going to get Of course to the appropriate pitch. Come and see at worried then public burden on options item selected.

Menu item item. The switch item to get item ID, then case, ID, action edit, command a uterus with some dairy activity. This then received dairy, then crud activity to cross the finish in return true. Kiss unread. It, Tom. Now you get up from some tasks in this in finish, they return true.

Return super obnoxious item selected, when does it so we're going to continue and then over eight more methods. So we'll come preacher Go for it. Okay, I've already pre typed them, you can see the other one is the on click, so just obtain the ID. And then of course check if the ID is the fob, then of course, we're going to focus in direct activity. Then of course, of course open or credit activity, just the way we did in our action bit in our menu. So the attachments context richer, of course, we have fruit pump to trap new business operating season, because we want to show custom fonts in this particular picture.

So then we have their own podcast, if you press the back button, we're going to make sure that you finish this activity. So we'll come in and say our own credit method, then activerain then protected void on credit, then hundred sentences. Then, super encrypt the unsaved instance state the new currency set, contract Our detailed activity detail then initially widgets, then of course receive financial data and does it Okay. Is it so this is this will make up our detailed activity

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.