First, you would have to edit the class FriendlyMessage
and place an attribute that supports Date and Time information. The Class Calendar
or Date
are great for this. Here are more information for the class Calendar
.
Do the get and set methods as you have for the other attributes.
Then you will have to include in the layout of the messages, item_message
, one TextView
to display the date and time. You will also need to change the Message Adapter to display the information correctly.
Then you just change the method populateViewHolder()
to define the TextView
date with the method of capturing the date of FriendlyMessage
.
If everything doesn’t work, see how it shows the messages and the name and try to copy the method to date.